I've created a simple test scenario with two classes (separate camel
contexts) and a few very simple routes for the purposes of testing the "vm"
component. The routes are as follows:

Class1: tcp (via mina) -> vm:test
Class2: vm:test -> file:outbox

Upon running the two classes and sending a message over, I get confirmation
from the first class that the TCP message has been received and sent to the
vm queue. The second class however, never receives the message. The camel
documentation says the following:

/[...] VM supports communication across CamelContext instances - so you can
use this mechanism to communicate across web applications (provided that
camel-core.jar is on the system/boot classpath)./

I also found a post from Claus saying:

/Its a cheap way of sharing between multiple WAR files with the cost of
having camel-core in the bootstrap classloader. /

OK. So I must admit that my knowledge of class loading and how that works
is a bit limited, however I believe I've done my due diligence and wrestled
with this for bit and I simply cannot get it to work. I have all of the
jars that come with the camel distribution specified in the "Java Build
Path" of my project in Eclipse. In Eclipse there is a "Run Configurations"
dialog. Within that dialog there is a "Classpath" tab. Within that tab
there are two nodes: "Bootstrap Entries" and "User Entries". I have tried
adding multiple jars (including the camel-core jar as referenced above) to
the "Bootstrap Entries" node. Unfortunately, every time I am greeted with
an exception of some kind. What am I missing? Is there a simple guide on
how to get this vm component working?

View this message in context: http://camel.465427.n5.nabble.com/How-exactly-to-get-the-vm-component-to-work-tp5730678.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Christian Mueller at Apr 11, 2013 at 8:44 pm
    Our unit tests are a good source [1].



    View this message in context: http://camel.465427.n5.nabble.com/How-exactly-to-get-the-vm-component-to-work-tp5730678p5730733.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Laowai at May 2, 2013 at 3:50 am

    I'm struggling with this exactly same issue, how to get the VM component to
    work. I'm at the same point as OP, trying to figure out how to share
    camel-core between the WAR files. Also, I'm not expert in class loading but
    can see from the logs that the problems are related to dependecies.

    I'm running WARs in Apache Tomcat and using Maven projects to build the WAR

    The main problem I'm having at the moment is that I cannot sort out the
    dependencies for the shared camel-core. If I share only camel-core component
    I get class loader exception related to Log dependecies. If I share also
    log4j, slf4j and slf4j-api (dependencies included by default in the maven
    project) I get exception related to commons-log. If I remove all log
    dependencies there is another exception.

    I'm quite sure that OP has same/similar problem with the dependencies as
    sharing just camel-core doesn't seem to be enough.

    The unit tests are demonstrating how to use VM, but doesn't answer to the
    question how to share the camel-core which is key to get the VM working.

    Are there some other packages that must be also shared with camel-core? Any
    documentation, tutorials, examples about how to share camel-core?


    View this message in context: http://camel.465427.n5.nabble.com/How-exactly-to-get-the-vm-component-to-work-tp5730678p5731878.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
postedApr 10, '13 at 8:03p
activeMay 2, '13 at 3:50a



site design / logo © 2021 Grokbase