On 6/27/07, borgel <[EMAIL PROTECTED]> wrote:
Hi, I am trying to figure out how to use Camel. Let's say I have three applications (A, B and C), running on Tomcat. Application C has employee information that I would like to use in application A and B. Can I use Camel to send messages between these applications?
Sure! :) Are the 3 applications in the same JVM; or in separate ones? Also are they deployed as a single unit all the time; or could they come and go individually?
If so, how do I do that? If I configure Camel in all of these applications they will have different CamelContext. Can I set up one instance of Camel and use that in all applications? I guess I am trying to implement the Message Channel pattern (http://activemq.apache.org/camel/message-channel.html). I just don't know how to do that with Camel.
The simplest way to deal with communication between applications or services (which may individually be started/stopped, be inside different class loaders or deployed across different JVMs) is often using messaging. Then the applications are completely decoupled across time, location and JVM. e.g. using ActiveMQ queues for example. Another option could be to use disk (file based messaging). If you deploy the 3 WARs together, you could put Camel in the system classpath & each web app could share the same CamelContext to exchange messages via in-memory SEDA queues. Or if you really wanted to use a local CamelContext in each web app, but still exchange messages using in-memory SEDA we could introduce some kinda static version of the in memory queue component; so that each web app could communicate using in-memory SEDA queues yet use their own CamelContexts. Though you'd have to be careful to ensure that Camel is on the system class loader (or a shared classloader) across the web apps. -- James ------- http://macstrac.blogspot.com/