Make sure MyClass implements Serializable and you may even have to provide a fixed serialVersionId in the class so the JVM can thread it as the same class on both JVMs.
On Thu, Feb 25, 2010 at 11:54 PM, Alexandros Karypidis <[email protected]> wrote: > Thank you for your replies. I have managed to get the VM transport to work > by putting Camel (and its dependencies) in jetty/lib/ext. However, I am only > able to exchange primitive Java types. Camel complains about not having a > type converter for it. I am using POJOs like this: > > The inteface (exists in both WARs): > @InOnly // vm:/ transport is one-way > public interface Messaging { > send (Integer i); // works > send (String s); // works > send (MyClass val); // FAILS ! <======= > } > > In one WAR I have: > > @Consume(uri = "vm:mychannel") > public void onMessage(String msg) {...} // works > @Consume(uri = "vm:mychannel") > public void onMessage(Integer msg) {...} // works > @Consume(uri = "vm:mychannel") > public void onMessage(MyClass msg) {...} // NOT INVOKED ! <======= > > In the other WAR I have: > > @Produce(uri = "vm:mychannel") > protected Messaging engine; > > public void testMessaging() { > send ("hello"); // works > send (1); // works > send(new MyClass()); // FAILS! <===== > } > > MyClass is in both WARs. > > On 24/2/2010 2:56 μμ, Ashwin Karpe wrote: >> >> Hi, >> >> Check out the SEDA, Direct and VM components for in-VM communication >> http://camel.apache.org/seda.html http://camel.apache.org/seda.html >> http://camel.apache.org/direct.html http://camel.apache.org/direct.html >> http://camel.apache.org/direct.html http://camel.apache.org/direct.html >> >> For differences between them, check >> >> http://camel.apache.org/how-do-the-direct-event-seda-and-vm-endpoints-compare.html >> >> http://camel.apache.org/how-do-the-direct-event-seda-and-vm-endpoints-compare.html >> >> Cheers, >> >> Ashwin... >> >> karypid 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. >>> >>> >>> >>> >> >> ----- >> --- >> Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence >> Progress Software Corporation >> 14 Oak Park Drive >> Bedford, MA 01730 >> --- >> +1-972-304-9084 (Office) >> +1-972-971-1700 (Mobile) >> ---- >> Blog: http://opensourceknowledge.blogspot.com/ >> >> >> > > -- 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
