3 Replies Latest reply on Jul 15, 2011 7:57 AM by Keith Babo

    Tighter CDI + Camel integration

    Tom Fennelly Master

      I started playing with this a little.

       

      First thing I tried was to see what would be involved in wiring the CDI BeanManager into the CamelContext used by our camel components.  Could we reference CDI beans from Camel routes in the same way you can reference Spring beans e.g. to("bean:MagicCDIBean"). 

       

      I first created a Camel Registry impl which has access to the CDI BeanManager.  Hit issues here doing the name (String) based lookups on the BeanManager... never seemed to work... all the cdi beans seem to have a null name and I can't set them.

       

      Then I decided to just focus on exposing SwitchYard CDI bean Services as beans through this Camel Registry.  I got this working through a hack... by matching up the requested bean name against the SwitchYard CDI Bean service QName.

       

      You can see the code here:

       

      Not really sure what this gets us so far.  We can already invoke SwitchYard services from camel using "switchyard:/XXXService".  Difference is, the "switchyard:/..." version is going through the SwitchYard exchange mechansim.

       

      There's also this Github project which is interesting: https://github.com/obergner/camelpe.  I'm waiting on an email reply from the author, hoping he might have some useful input.

       

      Keith... I know you had some ideas... fire them out here please