You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by shindito <at...@gmail.com> on 2012/09/13 14:21:25 UTC

How does a Camel component update change existing routes

Hello,

I'm using the JMS Component to create a JMS application which have to types
of toutes:
1) from vm IM endpoints to JMS topics.
2) from JMS topics to user processors.
The JMS Component uses JNDI for topic/connection factory resolution.  And I
want to change the physical data of this component -the provider url in
order to use a different machine as the JMS Provider.

My question is: how should I switch/update the component, in order to have
the change reflected by all already existing routes which are using this
component?

Is it going to work like this:
camelContext.stop();
camelContext.removeComponent(componentName); //remove old component
camelContext.addComponent(componentName, newComponent);
camelContext.start()

If not, what is the "Camel"-like approach to have this component
configuration change reflected in all routes?

Thanks for your help!

Best regards,
Atanas








--
View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-change-existing-routes-tp5719275.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How does a Camel component update change existing routes

Posted by shindito <at...@gmail.com>.
Yep, it's about the camel vm component. I'm using 2.9.0.
But yesterday I've managed to resolve the issue: It seems that after
cameContext restart previously created producerTemplates are no longer
valid since they've been created by the camecontext with the old component
 . . . If I create a new producerTemplate after the restart everything is
ok. I will try with restarting the template because creating a new each
time is quite expensive.

On Fri, Sep 14, 2012 at 9:07 AM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5719338h25@n5.nabble.com> wrote:

> On Thu, Sep 13, 2012 at 5:42 PM, shindito <[hidden email]<http://user/SendEmail.jtp?type=node&node=5719338&i=0>>
> wrote:
>
> > So, I have two types of routes:
> > 1) from vm:... to jms:topic..
> > 2) from jms:topic... to user processor
> >
> > I've tried restarting the routes while changing the component - after
> that
> > the second type of routes still consume from the old jms provider ...
> and
> > these consuming from vm don't work at all
> >
> > But If I restart the whole context, the 2) routes start consuming from
> the
> > new jms Provider (as expected)! But still, the routes from vm do not
> work
> > after the restart . . .
> >
>
> And the vm is the Camel VM component, not the in-memory vm transport of
> AMQ?
>
> What version of Camel do you use?
>
> And if you run in some container, try creating a plain unit test, that
> runs outside the container.
> To rule out any container weirdness.
>
>
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719309.html
>
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5719338&i=1>
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719338.html
>  To unsubscribe from How does a Camel component update gets reflected by
> existing routes, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5719275&code=YXRhbmFzLnNoaW5kb3ZAZ21haWwuY29tfDU3MTkyNzV8NDUyMzYxMTg=>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719349.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How does a Camel component update change existing routes

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 13, 2012 at 5:42 PM, shindito <at...@gmail.com> wrote:
> So, I have two types of routes:
> 1) from vm:... to jms:topic..
> 2) from jms:topic... to user processor
>
> I've tried restarting the routes while changing the component - after that
> the second type of routes still consume from the old jms provider ... and
> these consuming from vm don't work at all
>
> But If I restart the whole context, the 2) routes start consuming from the
> new jms Provider (as expected)! But still, the routes from vm do not work
> after the restart . . .
>

And the vm is the Camel VM component, not the in-memory vm transport of AMQ?

What version of Camel do you use?

And if you run in some container, try creating a plain unit test, that
runs outside the container.
To rule out any container weirdness.


>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719309.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: How does a Camel component update change existing routes

Posted by shindito <at...@gmail.com>.
So, I have two types of routes:
1) from vm:... to jms:topic..
2) from jms:topic... to user processor

I've tried restarting the routes while changing the component - after that
the second type of routes still consume from the old jms provider ... and
these consuming from vm don't work at all

But If I restart the whole context, the 2) routes start consuming from the
new jms Provider (as expected)! But still, the routes from vm do not work
after the restart . . .



--
View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719309.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How does a Camel component update change existing routes

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah give them a try.

Notice #2 - shutting down a CamelContext, and starting the same
CamelContext instance again, is not guaranteed to properly startup
again. As you may have used some custom components / resources /
whatever, which safely cannot be-restarted again.

But still give it a try and see how far you get.


On Thu, Sep 13, 2012 at 4:30 PM, shindito <at...@gmail.com> wrote:
> Thanks for the prompt reply!
>
> Just to clarify: shutting down all the routes will not require a
> camelcontext restart?
> So, I have to options:
> 1) Stop all routes -> shutdown old component -> add new component -> start
> new component -> start all routes
> 2) Stop context -> shutdown old component -> add new component -> start
> context
>
> Is it like that?
>
> Thanks & regards,
> Atanas
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719296.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: How does a Camel component update change existing routes

Posted by shindito <at...@gmail.com>.
Thanks for the prompt reply!

Just to clarify: shutting down all the routes will not require a
camelcontext restart? 
So, I have to options:
1) Stop all routes -> shutdown old component -> add new component -> start
new component -> start all routes
2) Stop context -> shutdown old component -> add new component -> start
context

Is it like that?

Thanks & regards,
Atanas



--
View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-gets-reflected-by-existing-routes-tp5719275p5719296.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How does a Camel component update change existing routes

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 13, 2012 at 2:21 PM, shindito <at...@gmail.com> wrote:
> Hello,
>
> I'm using the JMS Component to create a JMS application which have to types
> of toutes:
> 1) from vm IM endpoints to JMS topics.
> 2) from JMS topics to user processors.
> The JMS Component uses JNDI for topic/connection factory resolution.  And I
> want to change the physical data of this component -the provider url in
> order to use a different machine as the JMS Provider.
>
> My question is: how should I switch/update the component, in order to have
> the change reflected by all already existing routes which are using this
> component?
>
> Is it going to work like this:
> camelContext.stop();
> camelContext.removeComponent(componentName); //remove old component
> camelContext.addComponent(componentName, newComponent);
> camelContext.start()
>

Yeah you would also need to stop/shutdown the component you remove, to
ensure its resources are cleaned up.

Some components may support updates for some of their options. I would
assume the JMS does a bit of that.
So you may just shutdown all the routes. and then change the options
on the jms component. And start the routes again.



> If not, what is the "Camel"-like approach to have this component
> configuration change reflected in all routes?
>
> Thanks for your help!
>
> Best regards,
> Atanas
>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-does-a-Camel-component-update-change-existing-routes-tp5719275.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen