Friday, February 24, 2012

Lets Talk ConFoo

I have the great honor of speaking at:
I am speaking at ConFoo Web Techno Conference. February 29th to March 2nd, 2012. Montreal
I will be speaking on tips and tricks of building a full enterprise solution using open source technologies. In this session attendees will learn about the different levels of concern within SOA and where to implement different frameworks within enterprise architectures. Tips and tricks that can only be learn through the school of hard knocks are presented here to give the attendee a big leap ahead in architected their systems. It will also point out commons trouble spots often encountered in large-scale systems. These are advanced system integration concepts with a focus on high availability using open source frameworks in a service-orientated architecture. It will cover best practice tips for implementing/architecting ESB, mediation router, and messaging in infrastructures needing large scale, high transaction capabilities.

Wednesday, February 1, 2012

Handling ActiveMQ disconnects in Camel CXF Routes Part 2

So previously I showed you how to setup error handling when working with Activemq from a CXF endpoint.  So that is fine, but what if you need ActiveMQ to be asynchronous?  CXF will define the route as synchronous, meaning ExchangePattern = InOut.  This will force the route to be synchronous, and therefore wait on a reply from the queue..... much like I spelled out in part 1.

But what if we need ActiveMQ to be asynchronous?  Seems easy, just change the exchange pattern to be InOnly for the ActiveMQ call like so:


So now your route returns much faster since it is not waiting on a reply from the ActiveMQ endpoint.  Cue the angels.......  but wait, what happens when we still need the error handling to catch the JMSException and return a predefined response if..... lets say.... ActiveMQ is down? 

With the ExchangePattern set to InOnly, you will see in SOAPUI that you just get an empty soap message.  So what happened to the predefined response?  If you have logging in you processor or bean that loads the response, you will see that it is still hitting your code, but it is not return the response for some reason.

THE REASON: The reason is you have an ExchangePattern of InOnly set when you run the onException code, this is causing the camel route to return before your processor is finished processing.  So your exception processing does not effect the return to the CXF endpoint.

THE SOLUTION: you need to specify the onException portion of your route to be InOut using the following:


Now you should see your processor defined response from the onException getting passed back to the endpoint.