You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SteveC <st...@nz.unisys.com> on 2013/02/08 11:13:57 UTC

VM Queues Disconnected after Karaf Bundle Update

I have 2 camel routes, each deployed in separate bundles to Fuse ESB
(7.0.0.fuse-061).

Route 1 accepts text via HTTP and send it to a vm queue, e.g. <to
uri="vm:TestQ"/>

Route 2 accepts input from the vm queue, e.g.. <from uri="vm:TestQ"/>, and
logs a msg.

Each route is deployed in a Karaf feature and they function correctly on
initial deployement, i.e. I can send a msg via HTTP to route1 and it is
passed to route 2 via the vm queue.

When I use the Karaf console Bundles page to update the bundle for either or
both bundles they stop and restart with no apparent errors but from then on
the vm queues are disconnected, e.g. I can send a msg via HTTP to route1 and
it sends the msg to the vm queue, but route 2 never sees the msg arrive from
the vm queue and eventually the exchange times out in route 1 (using InOut
MEP). 

Once in this state the only way to get the routes to link via the vm queue
again is to either bounce Fuse ESB or to uninstall/install the associated
features.

I've tried adding some options to see if behaviour will change but no joy -
tried pollTimeout and concurrentConsumers.

The only reason for the bundle update is to bounce in new configuration, it
is frustrating having to bounce Fuse ESB just to update the config for a
single bundle.

I've tried replacing the VM component with JMS i.e. using JMS queues, and
the behaviour is as expected without any problem.

Advice anyone?

Thanks
Steve



--
View this message in context: http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Henryk Konsek <he...@gmail.com>.
> Found the issue that causes VM producer and consumer to "disconnect" in an
> OSGi environment when a bundle is restarted.

Yeah, the fact that VM queues disconnects is apparently the bug. I
wanted to investigate it but you were first :) Thanks for taking look
at this.


-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by SteveC <st...@nz.unisys.com>.
Raul,

Thanks for you work. 

The turnaround time from raising the query, confirming the issue and
preparing a fix is impressive ;-)

Regards
Steve



--
View this message in context: http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205p5727461.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Thomas Weinschenk <th...@infoserve.endress.com>.
Hi Raul,

I am facing the same problem with 2.12.2 ? But it should be fixed since
2.11.0, how can this be?

Regards,
Thomas



--
View this message in context: http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205p5745046.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Raul Kripalani <ra...@evosent.com>.
Hi all,

Found the issue that causes VM producer and consumer to "disconnect" in an
OSGi environment when a bundle is restarted.
It looks like a bug in ServiceSupport#shutdown. See [1].

I filed CAMEL-6072 and CAMEL-6073, but before I commit the patch I'm
waiting on some feedback on from the rest of devs, because it's quite a
central piece in Camel.

Hopefully it'll make it in time for Camel 2.10.4 if the release is not yet
staged ;)

[1]
http://camel.465427.n5.nabble.com/Why-do-we-allow-executing-service-shutdown-logic-twice-or-more-times-tt5727429.html
.

Regards,

*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>

On Fri, Feb 8, 2013 at 10:13 AM, SteveC <st...@nz.unisys.com> wrote:

> I have 2 camel routes, each deployed in separate bundles to Fuse ESB
> (7.0.0.fuse-061).
>
> Route 1 accepts text via HTTP and send it to a vm queue, e.g. <to
> uri="vm:TestQ"/>
>
> Route 2 accepts input from the vm queue, e.g.. <from uri="vm:TestQ"/>, and
> logs a msg.
>
> Each route is deployed in a Karaf feature and they function correctly on
> initial deployement, i.e. I can send a msg via HTTP to route1 and it is
> passed to route 2 via the vm queue.
>
> When I use the Karaf console Bundles page to update the bundle for either
> or
> both bundles they stop and restart with no apparent errors but from then on
> the vm queues are disconnected, e.g. I can send a msg via HTTP to route1
> and
> it sends the msg to the vm queue, but route 2 never sees the msg arrive
> from
> the vm queue and eventually the exchange times out in route 1 (using InOut
> MEP).
>
> Once in this state the only way to get the routes to link via the vm queue
> again is to either bounce Fuse ESB or to uninstall/install the associated
> features.
>
> I've tried adding some options to see if behaviour will change but no joy -
> tried pollTimeout and concurrentConsumers.
>
> The only reason for the bundle update is to bounce in new configuration, it
> is frustrating having to bounce Fuse ESB just to update the config for a
> single bundle.
>
> I've tried replacing the VM component with JMS i.e. using JMS queues, and
> the behaviour is as expected without any problem.
>
> Advice anyone?
>
> Thanks
> Steve
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by SteveC <st...@nz.unisys.com>.
Thanks for the response.

Attached is a zip with 3 maven projects, one for each module and a parentpom
project that they both depend on.

Regards
Steve

ASB2.zip <http://camel.465427.n5.nabble.com/file/n5727298/ASB2.zip>  



--
View this message in context: http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205p5727298.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Henryk Konsek <he...@gmail.com>.
Hi Steve,

> Advice anyone?

Could you provide minimal Maven project creating modules we could
deploy it to the FuseESB in the version you mentioned? If so, I'll
take a look at it and diagnose the issue.

Best regards.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Raul,

a code sample? I need to create one again :)
Cause I don't have access to the original code anymore it's been more than
2.5 Years ago.
I know what you are talking of, we have a similar saying in Germany ;)
Shooting sparrows with cannons.
Never the less I'm gonna create a sample asap.

Basically it's been a SEDA service endpoint also registered as a OSGi
Service.
The Other route referenced it and only did sent to this SEDA endpoint. So
maybe that's the reason it did work :)
(to my knowledge it still works)

regards, Achim


2013/2/10 Raul Kripalani <ra...@evosent.com>

> Hi Achim,
>
> Would you mind explaining this approach a little bit? A code sample would
> be awesome.
>
> Until now we have suggested folks to use NMR, but installing 7 SMX bundles
> just to achieve inter-bundle communication seems like "shooting flies with
> a bazooka" (like we say here in Spain :D).
>
> I remember a thread sometime ago about creating a component to link any two
> routes across bundles via OSGi services, but don't know what happened with
> the idea thereafter.
>
> Regards,
> Raúl.
> On 8 Feb 2013 21:02, "Achim Nierbeck" <bc...@googlemail.com> wrote:
>
> > Hi,
> >
> > The routes in your bundles are all managed by the camel-core bundle.
> > Since you updated one of it the "old" reference still exists for the core
> > bundle.
> > So after updating a bundle containing routes you also need to refresh the
> > core bundle.
> >
> > Another way to work around this, or better something that did work
> already
> > for me, I registered a SEDA endpoint as service. This way I was able to
> > share a endpoint between two bundles as communication bridge.
> >
> > Regards, Achim
> >
> > sent from mobile device
> > Am 08.02.2013 11:30 schrieb "SteveC" <st...@nz.unisys.com>:
> >
> > > I have 2 camel routes, each deployed in separate bundles to Fuse ESB
> > > (7.0.0.fuse-061).
> > >
> > > Route 1 accepts text via HTTP and send it to a vm queue, e.g. <to
> > > uri="vm:TestQ"/>
> > >
> > > Route 2 accepts input from the vm queue, e.g.. <from uri="vm:TestQ"/>,
> > and
> > > logs a msg.
> > >
> > > Each route is deployed in a Karaf feature and they function correctly
> on
> > > initial deployement, i.e. I can send a msg via HTTP to route1 and it is
> > > passed to route 2 via the vm queue.
> > >
> > > When I use the Karaf console Bundles page to update the bundle for
> either
> > > or
> > > both bundles they stop and restart with no apparent errors but from
> then
> > on
> > > the vm queues are disconnected, e.g. I can send a msg via HTTP to
> route1
> > > and
> > > it sends the msg to the vm queue, but route 2 never sees the msg arrive
> > > from
> > > the vm queue and eventually the exchange times out in route 1 (using
> > InOut
> > > MEP).
> > >
> > > Once in this state the only way to get the routes to link via the vm
> > queue
> > > again is to either bounce Fuse ESB or to uninstall/install the
> associated
> > > features.
> > >
> > > I've tried adding some options to see if behaviour will change but no
> > joy -
> > > tried pollTimeout and concurrentConsumers.
> > >
> > > The only reason for the bundle update is to bounce in new
> configuration,
> > it
> > > is frustrating having to bounce Fuse ESB just to update the config for
> a
> > > single bundle.
> > >
> > > I've tried replacing the VM component with JMS i.e. using JMS queues,
> and
> > > the behaviour is as expected without any problem.
> > >
> > > Advice anyone?
> > >
> > > Thanks
> > > Steve
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Raul Kripalani <ra...@evosent.com>.
Hi Achim,

Would you mind explaining this approach a little bit? A code sample would
be awesome.

Until now we have suggested folks to use NMR, but installing 7 SMX bundles
just to achieve inter-bundle communication seems like "shooting flies with
a bazooka" (like we say here in Spain :D).

I remember a thread sometime ago about creating a component to link any two
routes across bundles via OSGi services, but don't know what happened with
the idea thereafter.

Regards,
Raúl.
On 8 Feb 2013 21:02, "Achim Nierbeck" <bc...@googlemail.com> wrote:

> Hi,
>
> The routes in your bundles are all managed by the camel-core bundle.
> Since you updated one of it the "old" reference still exists for the core
> bundle.
> So after updating a bundle containing routes you also need to refresh the
> core bundle.
>
> Another way to work around this, or better something that did work already
> for me, I registered a SEDA endpoint as service. This way I was able to
> share a endpoint between two bundles as communication bridge.
>
> Regards, Achim
>
> sent from mobile device
> Am 08.02.2013 11:30 schrieb "SteveC" <st...@nz.unisys.com>:
>
> > I have 2 camel routes, each deployed in separate bundles to Fuse ESB
> > (7.0.0.fuse-061).
> >
> > Route 1 accepts text via HTTP and send it to a vm queue, e.g. <to
> > uri="vm:TestQ"/>
> >
> > Route 2 accepts input from the vm queue, e.g.. <from uri="vm:TestQ"/>,
> and
> > logs a msg.
> >
> > Each route is deployed in a Karaf feature and they function correctly on
> > initial deployement, i.e. I can send a msg via HTTP to route1 and it is
> > passed to route 2 via the vm queue.
> >
> > When I use the Karaf console Bundles page to update the bundle for either
> > or
> > both bundles they stop and restart with no apparent errors but from then
> on
> > the vm queues are disconnected, e.g. I can send a msg via HTTP to route1
> > and
> > it sends the msg to the vm queue, but route 2 never sees the msg arrive
> > from
> > the vm queue and eventually the exchange times out in route 1 (using
> InOut
> > MEP).
> >
> > Once in this state the only way to get the routes to link via the vm
> queue
> > again is to either bounce Fuse ESB or to uninstall/install the associated
> > features.
> >
> > I've tried adding some options to see if behaviour will change but no
> joy -
> > tried pollTimeout and concurrentConsumers.
> >
> > The only reason for the bundle update is to bounce in new configuration,
> it
> > is frustrating having to bounce Fuse ESB just to update the config for a
> > single bundle.
> >
> > I've tried replacing the VM component with JMS i.e. using JMS queues, and
> > the behaviour is as expected without any problem.
> >
> > Advice anyone?
> >
> > Thanks
> > Steve
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by SteveC <st...@nz.unisys.com>.
I tried adding the VM component as a separate OSGI service e.g. 


And then used a reference to the service in my 2 separate camel routes e.g. 



And change the from/to uri to be e.g. <from uri="sharedvm:TestQ">

This worked ok when initially installed but displayed the same VM queue
disconnected behaviour when I did a bundle update on route2. Partial good
news is a bundle update on route1 does function okay. 

I next tried using the Hazelcast:seda component instead of VM and found that
it worked perfectly through bundle updates of either route1 or route2. I
would really love to use this instead of VM because it is is a clustered
solution and seems to be performant. Unfortunately this component does not
seem to support request/reply which I need for my usecase. 

So any other ideas?

Thanks
Steve



--
View this message in context: http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205p5727345.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by SteveC <st...@nz.unisys.com>.
Thanks for your reply Achim.

I will try the approach you suggest - first I will need to learn how to
expose a vm component as an OSGi service of course - I'll let you know how I
get on.

Regards
Steve



--
View this message in context: http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205p5727300.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VM Queues Disconnected after Karaf Bundle Update

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

The routes in your bundles are all managed by the camel-core bundle.
Since you updated one of it the "old" reference still exists for the core
bundle.
So after updating a bundle containing routes you also need to refresh the
core bundle.

Another way to work around this, or better something that did work already
for me, I registered a SEDA endpoint as service. This way I was able to
share a endpoint between two bundles as communication bridge.

Regards, Achim

sent from mobile device
Am 08.02.2013 11:30 schrieb "SteveC" <st...@nz.unisys.com>:

> I have 2 camel routes, each deployed in separate bundles to Fuse ESB
> (7.0.0.fuse-061).
>
> Route 1 accepts text via HTTP and send it to a vm queue, e.g. <to
> uri="vm:TestQ"/>
>
> Route 2 accepts input from the vm queue, e.g.. <from uri="vm:TestQ"/>, and
> logs a msg.
>
> Each route is deployed in a Karaf feature and they function correctly on
> initial deployement, i.e. I can send a msg via HTTP to route1 and it is
> passed to route 2 via the vm queue.
>
> When I use the Karaf console Bundles page to update the bundle for either
> or
> both bundles they stop and restart with no apparent errors but from then on
> the vm queues are disconnected, e.g. I can send a msg via HTTP to route1
> and
> it sends the msg to the vm queue, but route 2 never sees the msg arrive
> from
> the vm queue and eventually the exchange times out in route 1 (using InOut
> MEP).
>
> Once in this state the only way to get the routes to link via the vm queue
> again is to either bounce Fuse ESB or to uninstall/install the associated
> features.
>
> I've tried adding some options to see if behaviour will change but no joy -
> tried pollTimeout and concurrentConsumers.
>
> The only reason for the bundle update is to bounce in new configuration, it
> is frustrating having to bounce Fuse ESB just to update the config for a
> single bundle.
>
> I've tried replacing the VM component with JMS i.e. using JMS queues, and
> the behaviour is as expected without any problem.
>
> Advice anyone?
>
> Thanks
> Steve
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/VM-Queues-Disconnected-after-Karaf-Bundle-Update-tp5727205.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>