On Tue, Feb 23, 2010 at 11:25 PM, Alexandros Karypidis <[email protected]> wrote: > Hello, > > I need to create a modular application using Camel. The structure is that > there is a "core" module and some peripheral "adapter" modules, each of > which is packaged as a WAR and deployed in the same container (Jetty). > > What would be the most efficient way perform synchronous request-reply > message exchanges among the "core" and the "adapters"? > > The aparent way for me is to have each module export its API via a web > service and have one module invoke the other using SOAP/HTTP. Performance is > important however and I'd like to avoid that, since all these WARs are meant > to be installed in the same JVM (one jetty container). > > Thank you in advance. >
You can use the Camel VM component which works in the same JVM (but you gotta test it to be 100% sure as its all class loader dependent). eg you probably must throw camel-core into some jetty/lib folder to have it shared among the WARs. http://camel.apache.org/vm Or you can deploy a WAR with a ActiveMQ broker and then use AMQ client to communicate between the other WARs. http://camel.apache.org/activemq.html The broker can be in memory only and use vm as transport, for efficiency. For example this tutorial can give a little help http://camel.apache.org/tutorial-jmsremoting.html And there is also the SOAP/REST etc you can use. And in good old days you could consider RMI as well. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
