Camel and RabbitMQ
A common model for implementing EIP in Java, is to use Apache Camel, with some sort of MQ or JMS backing. One of the more interesting MQ frameworks in use today is the Erlang-based RabbitMQ.
Camel is a very widely used integration platform. It's very flexible and takes care of wiring up services, mediating messages, transforming data, among many other useful things. It also comes with tons of components out of the box. Notice, one of the components it supports is AMQP. However, that would make life far too easy for RabbitMQ users. What the Camel documentation doesn't mention is that Camel is using Apache's Qpid as the AMQP implementation. For whatever reason, Qpid does not play nicely with RabbitMQ, thus the need for some help from, the always handy, Spring Framework.
Spring offers an AMQP solution, with the Spring AMQP module. Since, Spring and RabbitMQ are owned by the same company, it's pretty clear that they're designed to work together. However, in order to get Camel talking to Spring AMQP, we need to roll our own component -- or better yet -- troll Github.
New Design and Jekyll Migration
Welcome to the new iteration of my site. I finally spent some time thinking about and designing the new version of the site. Unlike the previous layout, I can honestly say I'm proud of how it looks and I'm excited to write articles on it. The design is inspired by a template from John O'Nolan, but I changed the colors, fonts and most of the flow. Looks, aside, a lot of the excitement also comes from the migration of the blog to Github Pages, from Wordpress.
Wordpress is a fantastic platform for blogging and has a huge community for support and plugins. As much as I enjoyed the ease of use, I really wanted more control. I wanted a site that's more nicely suited to technical blogging and ideally, one where I don't have to pay for hosting. An option I considered was using Blogger (via Google Apps), but there is a lack of control there, and it's a massive pain to get code highlighting working correctly -- ditto for Tumblr. I also wanted a space where I could host some images, CSS and JS with my site. Luckily the solution that fit all the criteria was Github Pages.
Wiring Restlet's JAX-RS with Spring
RESTful web services are all the rage these days and Java's no exception. The most mature among the RESTful frameworks in Java, is the Restlet Framework. In fact, the Restlet developers, had a lot of input on the JAX-RS spec and therefore support the standard really well.
However, one of the issues I had when starting with Restlets (using JAX-RS), was getting them to work with Spring. Restlets alone work well with Spring, but using the JAX-RS extension was slightly more challenging, as you have to create your own method of injecting objects into the framework.
Officially an Open Source Contributor
Open source software is all about collaboration and I use it nearly every day. Unfortunately, it's been one-way relationship until very recently.
I was working with a great open source framework for encryption, called Jasypt. It stands for JAva Simplified encrYPTion and I recommend it for any encryption needs you may have. One of the killer features is the ability to encrypt property files and plug right into Spring's ServletContextPropertyPlaceholderConfigurer. Unfortunately I found a bug in this feature and reported it here. Shortly thereafter, the change was released to the public in version 1.7.1 and my small patch was helping people using this software.
In order for open source software to be successful, it's really critical that people contribute and, really, anyone can do it. Giving back to the open source community should be on top of all of our to-do lists.
Scala and CodeKata
Recently, my buddy Quy has been raving about Scala and CodeKata. So after much arm-twisting, I decided to check them out. Scala is a language built on top of the JVM, focusing mainly on functional programming (with the option to do imperative as well) -- all put together into a statically-typed, object-oriented package. After some reading and playing, I was sold on Scala and wanted to do some exercises to really get a feel for it. Enter CodeKata.
CodeKata is actually a really brilliant idea. Usually programmers practice and learn on the job, but really they should be practicing all the time and honing their skills. From the site:
Code Kata is an attempt to bring this element of practice to software development. A kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. The intent behind code kata is similar. Each is a short exercise (perhaps 30 minutes to an hour long). Some involve programming, and can be coded in many different ways. Some are open ended, and involve thinking about the issues behind programming. These are unlikely to have a single correct answer. I add a new kata every week or so. Invest some time in your craft and try them.
So I decided to try the karate chop exercise.
