Apache Camel - Proxy web service example

Well this was not planned at all that I would spend sunday morning working on an example for Apache Camel and also put on the load to write documentation for the example. I kinda did my shares of writing for last year ;)

Anyway we were discussing a web service proxy example for the FuseSource virtual training. As there are many ways to do this I wanted to contribute a little example to Apache as well.

In this example I chose to use the CXF component as the proxy front end in Camel. This allows end users to tap into the web service features from Apache CXF if needed. The communication with the real web service is pure HTTP based and therefore I simply use the Camel HTTP component for that.

To add a little more value to the example I added a step in the Camel route to use a Java Bean to validate and enrich the incoming request. For example suppose a client is sending illegal data to an existing web service and its too costly to fix that on the client. So by using Camel as a proxy, we can fix this, by patching the data.

The example will be part of the upcoming Apache Camel 2.5 release and the documentation is here.

No comments: