direct-vm in OSGI - how to handle context updates?
Hi folks, I am using direct-vm to link different camel contexts (environment is Karaf 2.3.3 and Camel 2.12.2). Everything works fine until I update one of the routes acting as the direct-vm cosumer. This leads to 'No consumers available ...' exceptions. The problems seems to be the fact, that the consumer must be started before the producer. But even when I try to restart the routes it might not work. Here is an example... Camel Context 1 / / Camel Context 2 / / Camel Context 3 / / E.g. in Karaf, drop them in the deploy folder and it works. But as soon as you change one of the files...your lost ;) Any idea how I can handle updates on direct-vm 'chained' context/routes? Regards, Thomas -- View this message in context: http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: direct-vm in OSGI - how to handle context updates?
Hi You can use the block option to allow some time to wait for the update to be complete. On Tue, Nov 18, 2014 at 3:36 PM, Thomas Weinschenk wrote: > Hi folks, > > I am using direct-vm to link different camel contexts (environment is Karaf > 2.3.3 and Camel 2.12.2). > Everything works fine until I update one of the routes acting as the > direct-vm cosumer. This leads to 'No consumers available ...' exceptions. > The problems seems to be the fact, that the consumer must be started before > the producer. But even when I try to restart the routes it might not work. > > Here is an example... > > Camel Context 1 > / > > > / > > Camel Context 2 > / > > > / > > Camel Context 3 > / > > > / > > E.g. in Karaf, drop them in the deploy folder and it works. But as soon as > you change one of the files...your lost ;) > > Any idea how I can handle updates on direct-vm 'chained' context/routes? > > Regards, > Thomas > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
Re: direct-vm in OSGI - how to handle context updates?
Hi Claus, Thank you for your answer. If I add a block it works. But I need the refresh/restart the context in the correct order. In my example route1, route2 and then route3. This works if I do it manually but I have no glue how this could work automatically in production. I deploy and update the files dynamically. Regards, Thomas -- View this message in context: http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759266.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: direct-vm in OSGI - how to handle context updates?
Hi The deploy folder is not as good to use. So if you want to refresh in specific order, then copy the files in the given order, but make sure to have delay between to give time to pickup the files one by one. I am not sure if the felix fileinstall sorts the files first or something when it scans the deploy folder. You can ask on karaf mailing list or dive into the codebase to see what the code does. On Tue, Nov 18, 2014 at 4:08 PM, Thomas Weinschenk wrote: > Hi Claus, > > Thank you for your answer. If I add a block it works. But I need the > refresh/restart the context in the correct order. In my example route1, > route2 and then route3. > > This works if I do it manually but I have no glue how this could work > automatically in production. I deploy and update the files dynamically. > > Regards, > Thomas > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759266.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
Re: direct-vm in OSGI - how to handle context updates?
Hi Claus, I don't see the problem on side of Karaf, Felix or OSGi at all or how the contexts are deployed. The problem is that in a dynamic environment the direct-vm consumer does not know the producers. Therefore the consumer cannot trigger a restart of the other contexts. Especially if the contexts are ‘chained’ like in my example. I suggest changing the behavior of the direct-vm component that a refresh of the consumer is not forcing the producers to refresh as well. What do you think? Regards, Thomas -- View this message in context: http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759310.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: direct-vm in OSGI - how to handle context updates?
Hi Thomas, As the “vm-producer” and “vm-consumer” are decoupled, you have to address the context start order from outside (such as deploy time). -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On November 19, 2014 at 4:05:22 PM, Thomas Weinschenk (thomas.weinsch...@infoserve.endress.com) wrote: > Hi Claus, > > I don't see the problem on side of Karaf, Felix or OSGi at all or how the > contexts are deployed. The problem is that in a dynamic environment the > direct-vm consumer does not know the producers. Therefore the consumer > cannot trigger a restart of the other contexts. Especially if the contexts > are ‘chained’ like in my example. > > I suggest changing the behavior of the direct-vm component that a refresh of > the consumer is not forcing the producers to refresh as well. What do you > think? > Regards, > Thomas > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759310.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >
Re: direct-vm in OSGI - how to handle context updates?
Hi Willem, Thanks for your answer. But what I don't understand, if the producer and consumer are decoupled, why do I have to restart both (or all) contexts at all to get it working. Wouldn't it make more sense to work similar to jms? Or at least be more dynamic. For example use a registry that does the wiring when it is needed. Regards, Thomas -- View this message in context: http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759438.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: direct-vm in OSGI - how to handle context updates?
You can use vm component which has the queues to hand off between different bundles On Fri, Nov 21, 2014 at 12:58 PM, Thomas Weinschenk wrote: > Hi Willem, > > Thanks for your answer. But what I don't understand, if the producer and > consumer are decoupled, why do I have to restart both (or all) contexts at > all to get it working. > > Wouldn't it make more sense to work similar to jms? Or at least be more > dynamic. For example use a registry that does the wiring when it is needed. > > Regards, > Thomas > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759438.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/