update JNDI camel registery at runtime

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

update JNDI camel registery at runtime

simholte
I create an instance of Camel at start up with the jndi registry:
   JndiRegistry registry = new JndiRegistry();
// register ejb's in the registry
...
   ModelCamelContext context = new DefaultCamelContext(registry);


I'm making heavy use of ejb's in my routes so to make things easier I want to register those routes in the JNDI registry.  This works fine if I have all the JNDI mappings at start up but I want to allow a user to add a new ejb at runtime.  When I try context.getRegistry() it's of type PropertyPlaceholderDelegateRegistry and I can't find a way to cast it back to the JNDI registry so I can bind additional beans.  Is my only option to destroy and recreate my CamelContext?

Camel version 2.12.2
Reply | Threaded
Open this post in threaded view
|

Re: update JNDI camel registery at runtime

Claus Ibsen-2
Hi

I think there is API on PropertyPlaceholderDelegateRegistry to get the
delegate which is your jndi registry.



On Thu, Feb 27, 2014 at 10:09 PM, simholte <[hidden email]> wrote:

> I create an instance of Camel at start up with the jndi registry:
>    JndiRegistry registry = new JndiRegistry();
> // register ejb's in the registry
> ...
>    ModelCamelContext context = new DefaultCamelContext(registry);
>
>
> I'm making heavy use of ejb's in my routes so to make things easier I want
> to register those routes in the JNDI registry.  This works fine if I have
> all the JNDI mappings at start up but I want to allow a user to add a new
> ejb at runtime.  When I try context.getRegistry() it's of type
> PropertyPlaceholderDelegateRegistry and I can't find a way to cast it back
> to the JNDI registry so I can bind additional beans.  Is my only option to
> destroy and recreate my CamelContext?
>
> Camel version 2.12.2
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/update-JNDI-camel-registery-at-runtime-tp5748047.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [hidden email]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io
Reply | Threaded
Open this post in threaded view
|

Re: update JNDI camel registery at runtime

Claus Ibsen-2
In reply to this post by simholte
Hi

I logged a ticket to make this easier in the future
https://issues.apache.org/jira/browse/CAMEL-7257

On Thu, Feb 27, 2014 at 10:09 PM, simholte <[hidden email]> wrote:

> I create an instance of Camel at start up with the jndi registry:
>    JndiRegistry registry = new JndiRegistry();
> // register ejb's in the registry
> ...
>    ModelCamelContext context = new DefaultCamelContext(registry);
>
>
> I'm making heavy use of ejb's in my routes so to make things easier I want
> to register those routes in the JNDI registry.  This works fine if I have
> all the JNDI mappings at start up but I want to allow a user to add a new
> ejb at runtime.  When I try context.getRegistry() it's of type
> PropertyPlaceholderDelegateRegistry and I can't find a way to cast it back
> to the JNDI registry so I can bind additional beans.  Is my only option to
> destroy and recreate my CamelContext?
>
> Camel version 2.12.2
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/update-JNDI-camel-registery-at-runtime-tp5748047.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [hidden email]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io