You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bpinto <br...@hotmail.com> on 2013/08/12 16:10:56 UTC

Enable/disable Intercept strategy at runtime

HI,

I am looking for a way to add interceptstrategy to a camel context during
runtime after the camel context has started. Similarly,I would also want to
disable the respective interceptstrategy while the camel context continues
to run.

1. Can this be done ? If yes how do I go about it?

I have looked into camelcontext.addInterceptstrategy and
camelcontext.getInterceptStrategies().remove() and restarted the routes, but
it doesnt seem to take effect.

The requirement is mainly to be able to add plugin behaviour on demand.

Any pointers would be helpful.

Thanks,
Brian




--
View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-Intercept-strategy-at-runtime-tp5737154.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Enable/disable Intercept strategy at runtime

Posted by bpinto <br...@hotmail.com>.
Thanks Claus that was helpful. Beats having to restart the context.



--
View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-Intercept-strategy-at-runtime-tp5737154p5737178.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Enable/disable Intercept strategy at runtime

Posted by Claus Ibsen <cl...@gmail.com>.
Yeah you would need to implement your own interceptor that is capable
of enabling / disabling other interceptors at runtime, if you want
"dynamic" behavior without camel context restarts.

Also there is a new Container SPI in 2.12
org.apache.camel.spi.Container

Which can be used in containers such as ServiceMix / Karaf to add this
interceptor in all camel apps so you dont have to add that to each
camel app individually.

Though the true dynamic behavior is a goal of 3.0.

On Mon, Aug 12, 2013 at 4:37 PM, bpinto <br...@hotmail.com> wrote:
> Thanks Claus,
>
> With the current version though, is it achievable only through camelcontext
> restarts?
>
> Thanks,
> Brian
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-Intercept-strategy-at-runtime-tp5737154p5737160.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Enable/disable Intercept strategy at runtime

Posted by bpinto <br...@hotmail.com>.
Thanks Claus,

With the current version though, is it achievable only through camelcontext
restarts?

Thanks,
Brian



--
View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-Intercept-strategy-at-runtime-tp5737154p5737160.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Enable/disable Intercept strategy at runtime

Posted by Claus Ibsen <cl...@gmail.com>.
This is a goal in Camel 3.0 to allow dynamic interceptors to be
added/removed at runtime.


On Mon, Aug 12, 2013 at 4:10 PM, bpinto <br...@hotmail.com> wrote:
> HI,
>
> I am looking for a way to add interceptstrategy to a camel context during
> runtime after the camel context has started. Similarly,I would also want to
> disable the respective interceptstrategy while the camel context continues
> to run.
>
> 1. Can this be done ? If yes how do I go about it?
>
> I have looked into camelcontext.addInterceptstrategy and
> camelcontext.getInterceptStrategies().remove() and restarted the routes, but
> it doesnt seem to take effect.
>
> The requirement is mainly to be able to add plugin behaviour on demand.
>
> Any pointers would be helpful.
>
> Thanks,
> Brian
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-Intercept-strategy-at-runtime-tp5737154.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen