You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mumbly <mc...@gmail.com> on 2009/11/25 18:50:21 UTC

Using Guice with Camel

I've been taking a look at using Camel with Guice for DI, but I'm having a
little trouble understanding exactly what the integration provides. I've got
the configuration aspect and that seems to work fine. But it is unclear to
me if/how to work with Guice enhanced components. Specifically, if I am
using a bean component which uses @Inject, it doesn't appear that the bean
is being pulled from the Guice context (in other words, the other components
aren't being injected).

I'm new to both Camel and Guice, so I could be missing something obvious
here or there may be another pattern for DI using Guice with Camel that I
missed. So I guess my basic question is does the Camel/Guice integration
provide the ability to inject components within the routing chain? with the
bean component?

I see in the Guice example included in the dist, but it only seems to deal
with using Guice for configuration of the routes.

--Tim
-- 
View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26517323.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Guice with Camel

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Nov 26, 2009 at 6:27 PM, mumbly <mc...@gmail.com> wrote:
>
> So to make things simple, let's base it on the existing Guice/Camel example.
> So in SomeBean.java, let's say I want to include an injected component and
> add:
>
> public class SomeBean {
>  @Inject
>  private OtherBean ob;
>
>  public void someMethod(String body) {
>     System.out.println("Received: " + body);
>     System.out.println("OtherBean: " + ob);
>  }
>
> Define OtherBean as you wish. I'd expect(hope) without any other
> configuration that I'd get a non-null result for OtherBean, just using
> default binding values. It seems that it should be able to autowire (or
> whatever the Guicey version of that term is) ob. But though the
> configuration seems to be done via Guice, I don't think once "inside the
> routing context" that Guice is used to build/instantiate the bean from:
>
> from("file://target/routeOutput?noop=true").
>                bean(new SomeBean());
>
> I can see that it seems to have been created by new and not via Guice. What
> I'm wondering is if there is some way that I can tell it to grab a via built
> up via Guice instead of passing a specific instance.
>

The fluent builder is *just* regular Java code. So instead of bean(new
SomeBean()); you should be able to refer to a object which Guice have
injected

@Inject (or whatever the Guice notion is)
private SomeBean some;

from ....
bean(some);



> Does that make sense? As I mentioned, I'm still new with both Guice and
> Camel, so I could be way off the mark here.
>
> --Tim
>
>
>
> willem.jiang wrote:
>>
>> What kind of Object you want to inject into the bean component?
>> Did you add that bind in your module ?
>>
>> Please let me have a look at your module class.
>>
>> Willem
>>
>> mumbly wrote:
>>> I've been taking a look at using Camel with Guice for DI, but I'm having
>>> a
>>> little trouble understanding exactly what the integration provides. I've
>>> got
>>> the configuration aspect and that seems to work fine. But it is unclear
>>> to
>>> me if/how to work with Guice enhanced components. Specifically, if I am
>>> using a bean component which uses @Inject, it doesn't appear that the
>>> bean
>>> is being pulled from the Guice context (in other words, the other
>>> components
>>> aren't being injected).
>>>
>>> I'm new to both Camel and Guice, so I could be missing something obvious
>>> here or there may be another pattern for DI using Guice with Camel that I
>>> missed. So I guess my basic question is does the Camel/Guice integration
>>> provide the ability to inject components within the routing chain? with
>>> the
>>> bean component?
>>>
>>> I see in the Guice example included in the dist, but it only seems to
>>> deal
>>> with using Guice for configuration of the routes.
>>>
>>> --Tim
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26532640.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Using Guice with Camel

Posted by Willem Jiang <wi...@gmail.com>.
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


Re: Using Guice with Camel

Posted by mumbly <mc...@gmail.com>.
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.

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?

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? 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? 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?

--Tim


willem.jiang wrote:
> 
> Hi,
> 
>   camel-guice has a jndi context which hold the reference of the JMS 
> component and the someBean. So you need to create that context in your 
> GuceServletConfig.
> 
> You can find use code in the MyActivitor[1] about how to create that 
> context.
> 
> [1] 
> https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
> 
> Willem
> mumbly wrote:
>> Thanks for all the help so far. You're example worked great.
>> 
>> I'm running into an error when integrating the camel routes into a webapp
>> where I use the guice servlet for initialization. I have the same set of
>> changes you included in your diff, but the startup happens from a
>> listener
>> defined in web.xml and looking like:
>> 
>> public class GuiceServletConfig extends GuiceServletContextListener {
>>     protected Injector getInjector() {
>>         Module camel = new MyModule();
>>         return Guice.createInjector(camel);
>>     }
>> 
>> there is some other code in there, but I've tried it with this simple
>> version. When I run, the error I get is:
>> 
>> com.google.inject.CreationException: Guice creation errors:
>> 
>>   while locating org.apache.camel.guice.GuiceCamelContext
>>   while locating org.apache.camel.CamelContext
>> 
>> 1 error
>> 	at
>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>> 	at
>> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:179)
>> 	at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
>> 	at com.google.inject.Guice.createInjector(Guice.java:92)
>> 	.
>> 
>> Any thoughts on this? I've confirmed that both the camel-guice and
>> camel-core jars are in the WEB-INF/lib.
>> 
>> --Tim
>>  
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26594078.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Guice with Camel

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

  camel-guice has a jndi context which hold the reference of the JMS 
component and the someBean. So you need to create that context in your 
GuceServletConfig.

You can find use code in the MyActivitor[1] about how to create that 
context.

[1] 
https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java

Willem
mumbly wrote:
> Thanks for all the help so far. You're example worked great.
> 
> I'm running into an error when integrating the camel routes into a webapp
> where I use the guice servlet for initialization. I have the same set of
> changes you included in your diff, but the startup happens from a listener
> defined in web.xml and looking like:
> 
> public class GuiceServletConfig extends GuiceServletContextListener {
>     protected Injector getInjector() {
>         Module camel = new MyModule();
>         return Guice.createInjector(camel);
>     }
> 
> there is some other code in there, but I've tried it with this simple
> version. When I run, the error I get is:
> 
> com.google.inject.CreationException: Guice creation errors:
> 
>   while locating org.apache.camel.guice.GuiceCamelContext
>   while locating org.apache.camel.CamelContext
> 
> 1 error
> 	at
> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
> 	at
> com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:179)
> 	at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
> 	at com.google.inject.Guice.createInjector(Guice.java:92)
> 	.
> 
> Any thoughts on this? I've confirmed that both the camel-guice and
> camel-core jars are in the WEB-INF/lib.
> 
> --Tim
>  


Re: Using Guice with Camel

Posted by mumbly <mc...@gmail.com>.
Thanks for all the help so far. You're example worked great.

I'm running into an error when integrating the camel routes into a webapp
where I use the guice servlet for initialization. I have the same set of
changes you included in your diff, but the startup happens from a listener
defined in web.xml and looking like:

public class GuiceServletConfig extends GuiceServletContextListener {
    protected Injector getInjector() {
        Module camel = new MyModule();
        return Guice.createInjector(camel);
    }

there is some other code in there, but I've tried it with this simple
version. When I run, the error I get is:

com.google.inject.CreationException: Guice creation errors:

  while locating org.apache.camel.guice.GuiceCamelContext
  while locating org.apache.camel.CamelContext

1 error
	at
com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
	at
com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:179)
	at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
	at com.google.inject.Guice.createInjector(Guice.java:92)
	.

Any thoughts on this? I've confirmed that both the camel-guice and
camel-core jars are in the WEB-INF/lib.

--Tim
 
-- 
View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26554341.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Guice with Camel

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

I made a patch which is based on current trunk guicy-jms example to 
implements you requirement. Hope it can help you.

Willem

### Eclipse Workspace Patch 1.0
#P camel-example-guice-jms
Index: src/main/java/org/apache/camel/example/guice/jms/SomeBean.java
===================================================================
--- src/main/java/org/apache/camel/example/guice/jms/SomeBean.java 
(revision 884351)
+++ src/main/java/org/apache/camel/example/guice/jms/SomeBean.java 
(working copy)
@@ -16,13 +16,18 @@
   */
  package org.apache.camel.example.guice.jms;

+import com.google.inject.Inject;
+
  /**
   * @version $Revision$
  */
  public class SomeBean {
+    @Inject
+    private Printer printer;

      public void someMethod(String body) {
-        System.out.println("Received: " + body);
+        printer.print(body);
+        //System.out.println("Received: " + body);
      }

      @Override
Index: src/main/java/org/apache/camel/example/guice/jms/Printer.java
===================================================================
--- src/main/java/org/apache/camel/example/guice/jms/Printer.java 
(revision 0)
+++ src/main/java/org/apache/camel/example/guice/jms/Printer.java 
(revision 0)
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.guice.jms;
+
+public class Printer {
+
+    public void print(String body) {
+        System.out.println("Received: " + body);
+    }
+
+}

Property changes on: 
src/main/java/org/apache/camel/example/guice/jms/Printer.java
___________________________________________________________________
Added: svn:keywords
    + Rev Date
Added: svn:eol-style
    + native

Index: src/main/java/org/apache/camel/example/guice/jms/MyModule.java
===================================================================
--- src/main/java/org/apache/camel/example/guice/jms/MyModule.java 
(revision 884351)
+++ src/main/java/org/apache/camel/example/guice/jms/MyModule.java 
(working copy)
@@ -16,6 +16,7 @@
   */
  package org.apache.camel.example.guice.jms;

+import com.google.inject.Injector;
  import com.google.inject.Provides;
  import com.google.inject.name.Named;
  import org.apache.activemq.ActiveMQConnectionFactory;
@@ -37,6 +38,7 @@

          // lets add in any RouteBuilder instances we want to use
          bind(MyRouteBuilder.class);
+        bind(Printer.class);
      }

      /**
@@ -48,4 +50,10 @@
      JmsComponent jms(@Named("activemq.brokerURL") String brokerUrl) {
          return JmsComponent.jmsComponent(new 
ActiveMQConnectionFactory(brokerUrl));
      }
+
+    @Provides
+    @JndiBind("myBean")
+    SomeBean someBean(Injector injector) {
+        return injector.getInstance(SomeBean.class);
+    }
  }
Index: src/main/java/org/apache/camel/example/guice/jms/MyRouteBuilder.java
===================================================================
--- 
src/main/java/org/apache/camel/example/guice/jms/MyRouteBuilder.java 
(revision 884351)
+++ 
src/main/java/org/apache/camel/example/guice/jms/MyRouteBuilder.java 
(working copy)
@@ -45,8 +45,7 @@
                  to("file://target/routeOutput");

          // set up a listener on the file component
-        from("file://target/routeOutput?noop=true").
-                bean(new SomeBean());
+        from("file://target/routeOutput?noop=true").beanRef("myBean");
      }

  }
\ No newline at end of file


mumbly wrote:
> So to make things simple, let's base it on the existing Guice/Camel example.
> So in SomeBean.java, let's say I want to include an injected component and
> add:
> 
> public class SomeBean {
>   @Inject
>   private OtherBean ob;
> 
>   public void someMethod(String body) {
>      System.out.println("Received: " + body);
>      System.out.println("OtherBean: " + ob);
>   }
> 
> Define OtherBean as you wish. I'd expect(hope) without any other
> configuration that I'd get a non-null result for OtherBean, just using
> default binding values. It seems that it should be able to autowire (or
> whatever the Guicey version of that term is) ob. But though the
> configuration seems to be done via Guice, I don't think once "inside the
> routing context" that Guice is used to build/instantiate the bean from:
> 
> from("file://target/routeOutput?noop=true").
>                 bean(new SomeBean());
> 
> I can see that it seems to have been created by new and not via Guice. What
> I'm wondering is if there is some way that I can tell it to grab a via built
> up via Guice instead of passing a specific instance.
> 
> Does that make sense? As I mentioned, I'm still new with both Guice and
> Camel, so I could be way off the mark here.
> 
> --Tim
> 
> 
> 
> willem.jiang wrote:
>> What kind of Object you want to inject into the bean component?
>> Did you add that bind in your module ?
>>
>> Please let me have a look at your module class.
>>
>> Willem
>>
>> mumbly wrote:
>>> I've been taking a look at using Camel with Guice for DI, but I'm having
>>> a
>>> little trouble understanding exactly what the integration provides. I've
>>> got
>>> the configuration aspect and that seems to work fine. But it is unclear
>>> to
>>> me if/how to work with Guice enhanced components. Specifically, if I am
>>> using a bean component which uses @Inject, it doesn't appear that the
>>> bean
>>> is being pulled from the Guice context (in other words, the other
>>> components
>>> aren't being injected).
>>>
>>> I'm new to both Camel and Guice, so I could be missing something obvious
>>> here or there may be another pattern for DI using Guice with Camel that I
>>> missed. So I guess my basic question is does the Camel/Guice integration
>>> provide the ability to inject components within the routing chain? with
>>> the
>>> bean component?
>>>
>>> I see in the Guice example included in the dist, but it only seems to
>>> deal
>>> with using Guice for configuration of the routes.
>>>
>>> --Tim
>>
>>
> 


Re: Using Guice with Camel

Posted by mumbly <mc...@gmail.com>.
So to make things simple, let's base it on the existing Guice/Camel example.
So in SomeBean.java, let's say I want to include an injected component and
add:

public class SomeBean {
  @Inject
  private OtherBean ob;

  public void someMethod(String body) {
     System.out.println("Received: " + body);
     System.out.println("OtherBean: " + ob);
  }

Define OtherBean as you wish. I'd expect(hope) without any other
configuration that I'd get a non-null result for OtherBean, just using
default binding values. It seems that it should be able to autowire (or
whatever the Guicey version of that term is) ob. But though the
configuration seems to be done via Guice, I don't think once "inside the
routing context" that Guice is used to build/instantiate the bean from:

from("file://target/routeOutput?noop=true").
                bean(new SomeBean());

I can see that it seems to have been created by new and not via Guice. What
I'm wondering is if there is some way that I can tell it to grab a via built
up via Guice instead of passing a specific instance.

Does that make sense? As I mentioned, I'm still new with both Guice and
Camel, so I could be way off the mark here.

--Tim



willem.jiang wrote:
> 
> What kind of Object you want to inject into the bean component?
> Did you add that bind in your module ?
> 
> Please let me have a look at your module class.
> 
> Willem
> 
> mumbly wrote:
>> I've been taking a look at using Camel with Guice for DI, but I'm having
>> a
>> little trouble understanding exactly what the integration provides. I've
>> got
>> the configuration aspect and that seems to work fine. But it is unclear
>> to
>> me if/how to work with Guice enhanced components. Specifically, if I am
>> using a bean component which uses @Inject, it doesn't appear that the
>> bean
>> is being pulled from the Guice context (in other words, the other
>> components
>> aren't being injected).
>> 
>> I'm new to both Camel and Guice, so I could be missing something obvious
>> here or there may be another pattern for DI using Guice with Camel that I
>> missed. So I guess my basic question is does the Camel/Guice integration
>> provide the ability to inject components within the routing chain? with
>> the
>> bean component?
>> 
>> I see in the Guice example included in the dist, but it only seems to
>> deal
>> with using Guice for configuration of the routes.
>> 
>> --Tim
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26532640.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Guice with Camel

Posted by Willem Jiang <wi...@gmail.com>.
What kind of Object you want to inject into the bean component?
Did you add that bind in your module ?

Please let me have a look at your module class.

Willem

mumbly wrote:
> I've been taking a look at using Camel with Guice for DI, but I'm having a
> little trouble understanding exactly what the integration provides. I've got
> the configuration aspect and that seems to work fine. But it is unclear to
> me if/how to work with Guice enhanced components. Specifically, if I am
> using a bean component which uses @Inject, it doesn't appear that the bean
> is being pulled from the Guice context (in other words, the other components
> aren't being injected).
> 
> I'm new to both Camel and Guice, so I could be missing something obvious
> here or there may be another pattern for DI using Guice with Camel that I
> missed. So I guess my basic question is does the Camel/Guice integration
> provide the ability to inject components within the routing chain? with the
> bean component?
> 
> I see in the Guice example included in the dist, but it only seems to deal
> with using Guice for configuration of the routes.
> 
> --Tim


Re: Using Guice with Camel

Posted by mumbly <mc...@gmail.com>.
That would be great. Expanding the example a bit to include some injected
components would be nice, assuming that is possible (or making it possible
if not).

--Tim


Claus Ibsen-2 wrote:
> 
> Hi
> 
> I think James Strachan can shed lights on the camel-guice as he build it.
> I am sure there are some features missing in this component so we can
> use help to improve it.
> 
> 
> On Wed, Nov 25, 2009 at 6:50 PM, mumbly <mc...@gmail.com> wrote:
>>
>> I've been taking a look at using Camel with Guice for DI, but I'm having
>> a
>> little trouble understanding exactly what the integration provides. I've
>> got
>> the configuration aspect and that seems to work fine. But it is unclear
>> to
>> me if/how to work with Guice enhanced components. Specifically, if I am
>> using a bean component which uses @Inject, it doesn't appear that the
>> bean
>> is being pulled from the Guice context (in other words, the other
>> components
>> aren't being injected).
>>
>> I'm new to both Camel and Guice, so I could be missing something obvious
>> here or there may be another pattern for DI using Guice with Camel that I
>> missed. So I guess my basic question is does the Camel/Guice integration
>> provide the ability to inject components within the routing chain? with
>> the
>> bean component?
>>
>> I see in the Guice example included in the dist, but it only seems to
>> deal
>> with using Guice for configuration of the routes.
>>
>> --Tim
>> --
>> View this message in context:
>> http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26517323.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26532525.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Guice with Camel

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

I think James Strachan can shed lights on the camel-guice as he build it.
I am sure there are some features missing in this component so we can
use help to improve it.


On Wed, Nov 25, 2009 at 6:50 PM, mumbly <mc...@gmail.com> wrote:
>
> I've been taking a look at using Camel with Guice for DI, but I'm having a
> little trouble understanding exactly what the integration provides. I've got
> the configuration aspect and that seems to work fine. But it is unclear to
> me if/how to work with Guice enhanced components. Specifically, if I am
> using a bean component which uses @Inject, it doesn't appear that the bean
> is being pulled from the Guice context (in other words, the other components
> aren't being injected).
>
> I'm new to both Camel and Guice, so I could be missing something obvious
> here or there may be another pattern for DI using Guice with Camel that I
> missed. So I guess my basic question is does the Camel/Guice integration
> provide the ability to inject components within the routing chain? with the
> bean component?
>
> I see in the Guice example included in the dist, but it only seems to deal
> with using Guice for configuration of the routes.
>
> --Tim
> --
> View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26517323.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus