You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ddewaele <dd...@gmail.com> on 2013/03/26 08:17:56 UTC

Integrating 2 deployable units (containing camel routes)

Hi,

We have 2 deployable units, EBA files , containing camel routes that are
deployed on Websphere. 

For those that don't know what an EBA is, it's an enterprise bundle archive
(basically an EAR file containing OSGI bundles).

We would like to have the ability to send messages that are being processed
in the camel route in EBA1 to a camel route in EBA2.

EBA2 has existing camel http/jms endpoints that we could use to do the
integration. It would keep the 2 units loosely coupled and the integration
would be straightforward.

We're also looking into performance, and using http/jms for communication
inside the same jvm  might also not be ideal.

Is using VM endpoints also an option here ? As both EBAs run in the same
JVM, would it be possible to directly exchange messages between these camel
routes ? I read on this mailing list that the VM endpoint was primarily
created for sharing messages between WAR files deployed in Apache Tomcat
etc.

What is your take on this ?

Thanks...



--
View this message in context: http://camel.465427.n5.nabble.com/Integrating-2-deployable-units-containing-camel-routes-tp5729827.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Integrating 2 deployable units (containing camel routes)

Posted by Christian Müller <ch...@gmail.com>.
The direct-vm components is based on the direct component and it's a
synchronous invocation.
The vm component is based on the seda component and it's an asynchronous
invocation.

We may should update or WIKI page about using this components in OSGI
world.
I do not have any experience using WAR deployments and OSGI bundles
together...

Another option is to register a service in the OSGI registry which can be
looked up and used by the other one.

Best,
Christian

On Tue, Mar 26, 2013 at 10:50 AM, ddewaele <dd...@gmail.com> wrote:

> Hi Christian,
>
> I was a bit confused by the documentation (does the direct-vm contain a
> copy/paste error ? It basically says the same as on the vm page). Both
> "support communication across CamelContext instances" but yet they differ ?
> It's also not clear that both can be used for inter OSGI bundle
> communication.
>
> *VM*
> 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).
>
> *Direct-VM*
> This component differs from the Direct component in that Direct-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 used the direct-vm and it does work accross bundles. However, in our case
> we have 1 Camel route defined in a OSGI bundle (bootstrapped using spring
> using an OSGI blueprint extender), while another Camel route is defined in
> a
> WAR file (the osgi frameworks wraps the war file in an OSGI bundle).
>
> I noticed that the route from the WAR file can not send messages using
> direct-vm to a route in a bundle.
> A route from a bundle can send a message to a route in another bundle.
>
> So I guess I have 2 options :
>
> 1. Move the camel route from the WAR into an actual OSGI bundle, put
> everything in the same EBA and use vm or direct-vm
> 2. Keep the 2 EBAs seperate (isolated) and integrate them using JMS.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Integrating-2-deployable-units-containing-camel-routes-tp5729827p5729841.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Integrating 2 deployable units (containing camel routes)

Posted by ddewaele <dd...@gmail.com>.
Hi Christian,

I was a bit confused by the documentation (does the direct-vm contain a
copy/paste error ? It basically says the same as on the vm page). Both
"support communication across CamelContext instances" but yet they differ ?
It's also not clear that both can be used for inter OSGI bundle
communication.

*VM*
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).

*Direct-VM*
This component differs from the Direct component in that Direct-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 used the direct-vm and it does work accross bundles. However, in our case
we have 1 Camel route defined in a OSGI bundle (bootstrapped using spring
using an OSGI blueprint extender), while another Camel route is defined in a
WAR file (the osgi frameworks wraps the war file in an OSGI bundle).

I noticed that the route from the WAR file can not send messages using
direct-vm to a route in a bundle.
A route from a bundle can send a message to a route in another bundle.

So I guess I have 2 options :

1. Move the camel route from the WAR into an actual OSGI bundle, put
everything in the same EBA and use vm or direct-vm
2. Keep the 2 EBAs seperate (isolated) and integrate them using JMS.




--
View this message in context: http://camel.465427.n5.nabble.com/Integrating-2-deployable-units-containing-camel-routes-tp5729827p5729841.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Integrating 2 deployable units (containing camel routes)

Posted by Christian Müller <ch...@gmail.com>.
We use the vm or direct-vm component for inter bundle communication. It
should be the fastest integration. But this integration is not so loosely
coupled as JMS which can persist the message is the consumer is not up and
running...

Because of an issue in the vm component we fixed recently [1], you may want
wait for the next Camel 2.10.5 or Camel 2.11.0 release (very soon).

[1] https://issues.apache.org/jira/browse/CAMEL-6073

Best,
Christian

On Tue, Mar 26, 2013 at 8:17 AM, ddewaele <dd...@gmail.com> wrote:

> Hi,
>
> We have 2 deployable units, EBA files , containing camel routes that are
> deployed on Websphere.
>
> For those that don't know what an EBA is, it's an enterprise bundle archive
> (basically an EAR file containing OSGI bundles).
>
> We would like to have the ability to send messages that are being processed
> in the camel route in EBA1 to a camel route in EBA2.
>
> EBA2 has existing camel http/jms endpoints that we could use to do the
> integration. It would keep the 2 units loosely coupled and the integration
> would be straightforward.
>
> We're also looking into performance, and using http/jms for communication
> inside the same jvm  might also not be ideal.
>
> Is using VM endpoints also an option here ? As both EBAs run in the same
> JVM, would it be possible to directly exchange messages between these camel
> routes ? I read on this mailing list that the VM endpoint was primarily
> created for sharing messages between WAR files deployed in Apache Tomcat
> etc.
>
> What is your take on this ?
>
> Thanks...
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Integrating-2-deployable-units-containing-camel-routes-tp5729827.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>