mumbly wrote:
So I managed to get rid of the error message. I'm not sure if it is possible
to make the error message more informative. For example, in a very similar
situation, I had an error message when I had a route builder with jms, when
I didn't have camel-jms loaded and I got:

1) Failed to resolve endpoint: jms://test.MyQueue due to: No component found
with scheme: jms
  while locating org.apache.camel.guice.GuiceCamelContext
  while locating org.apache.camel.CamelContext

Anyway, just a minor point.
Camel supports to find the component automatically, you need to make sure the camel-jms.jar is in your class patch before loading the camel context.


I do have a couple of general questions in trying to understand things.

So is .beanRef() a Guice specific method or is it used for Spring, also? Or
is it simply built for using JNDI and it is just the fact that Guice acts as
a JNDI store backed by Guice beans?
.beanRef() is a DSL which let you to find the bean instance from the camel registry. This registry can be a spring application context or a jndi context. In your case, we create a @Provider method which creates a bean instance from Guice injector and register it with @JndiBind annotation into the Camel Guice jndi.


And what is the thinking behind Guice JNDI? Is it just there to allow for a
simple way for retrieving beans that have been initialized by Guice without
carrying around the injector?
You can treat Guice JNDI as another registry that can be used by camel context. You can register not only bean instance , but also the processor, components , etc.
These objects can be initialized by Guice injector or not.

I see that it is used to inject values that
have been defined in jndi.properties, but is it more generally usable to get
any and all Guice enhanced beans as long as they have been annotated?
Current jndi.properties name is bind with the injector, I don't think it can help you to get the Guice enhanced beans there,

Do I
need to do anything other than annotate the bean? Will it serve to fully
build up the bean graph of all components associated with the bean annotated
with JMS?
You can get the @Inject annotated beans from the Guice Injector.
If you want the bean to be put into the camel context registry, you need add the @JndiBind anntotation.

--Tim




Willem

Reply via email to