Problem Overview
I'm using apache camel 2.4 and have been asked to setup an internal messaging system in one of our maven/spring projects. This may seem a little weird but its because they have plans to separate some functionality out at a later date and want the integration side already covered.
Desired Functionality
Basically I have a bean (A) that does some processing and creates a serializable object. I have another bean (B) that accepts said serializable object and does some additional processing that we want to occur asynchronously.
The plan is to have bean (A) produce a message via the SEDA component of Camel and have it consumed by bean (B) internally.
What I've Done
So far I have implemented this by;
-Creating a RouteBuilder implementation that defines the route.
-Configuring my CamelContext in spring to use said route builder.
-Creating a "producer" class that has the CamelContext as a property and uses this to create a ProducerTemplate with which to send the message. - used by bean (A).
-Defining bean (B) as the consumer (via "bean:beanB" in the configured RouteBuilder).
Question
This works but, being new to Camel, i'm not sure if this is a very good way of implementing the desired functionality. Having looked further at the Camel docs its seems like there's lots of different ways I could do the same thing (configuring the route in spring, rather than defining a RouteBuiler implementation, using the SedaEndpoint implementation, defining the ProducerTemplate in spring and using this as a dependency rather than the CamelContext itself.....).
What would be standard practice / best method for implementing the desired functionality?
you can wire things together various ways, but what you have described is pretty standard...
that said, you might consider the following...