Friday, 24 September 2010

Dynamically testing Camel routes

Share
Testing Camel routes with:

mvn camel:run

is not a good idea generally. The right place to test a route is a unit test.

Apache Camel comes with a very sophisticated test framework. It's great, no doubt about it! But, I wanted something more.

I saw many examples published on many sites where people copied and pasted the original routes modifying from source and adding mock endpoints. I was scared particularly by one quite complex route defined in XML configuration file. The test route was almost a copy and paste. Almost, because it got unsynchronised somewhere during the development (I guess) and the test route was different from the original one. This approach seemed to me to be very error-prone.

I wanted not to copy and paste my routes, but automatically modify them slightly and then test. I wanted to dynamically change my original routes instead of copy and pasting parts of the original ones. Here is what I intended to do:
  1. dynamically override from endpoint and manually fire the route directly from my test;
  2. dynamically add mock endpoint at the end of the route so that I can verify if the messages were ok.

See how I did it.

Wednesday, 15 September 2010

Connecting to EJBs from Camel

Share
Today I will show you how to connect to a remote SLSB component directly from Camel using Spring. This post is a continuation of my previous one: Connecting to EJBs from Spring.

Monday, 13 September 2010

Connecting to EJBs from Spring

Share
While preparing my next exercise I had to first find a way how to connect to a remote SLSB from Spring.

It turned out to be childishly simple. See how I did it.

Monday, 6 September 2010

ServiceMix 4 as a pure bus

Share
ESB stands for Enterprise Service Bus. These days most ESB are more like application servers than pure buses.

Let's get back to the roots. Today I will not deploy any Web Services to SM 4, instead I will make an existing one available on the bus. And what is more it will be a .NET Web Service.

I will use SM 4.2 and CXF provider and consumer constructs. All packaged as OSGi bundle of course.

Wednesday, 1 September 2010

10 More most useful iPhone tips (Part 2)

Share
This post is a continuation of my 3 previous posts:
Let's get rolling.