Tom and I had a quick chat on IRC about this, so I'll summarize for the forum thread.
The main thing we are trying to do is make CDI beans available as bean references within a Camel route. It's common to augment the processing logic of a route with a bean definition and bean references can also be used in endpoint configuration (IIRC) to influence component behavior (e.g. filtering). This type of thing is specific to the Camel route and distinct from CDI services which have been registered on the bus.
We discussed possible ways to wire this in and Tom believes that we have most of the plumbing in place today. What we need to add is the ability to register CDI beans by name. The @Named annotation looks promising for this purpose.
One other item we discussed is the use of the Camel test support (test/mock endpoints) in a Camel MixIn. One of the nice things here is that you can test @Reference invocations using mock endpoints defined in Camel. I'm sure there's lots of other possibilities too.
I've rejigged a bit and have the same thing working for any CDI bean in the module (I'm assuming it won't work for beans outside the deployment unit... need to check that).
Code is in the same place...
- Components: https://github.com/tfennelly/jboss-switchyard-components/tree/camel+cdi
- Quickstarts: https://github.com/tfennelly/jboss-switchyard-quickstarts/tree/camel+cdi (I modified the "camel-service" quickstart)
Fantastic! Haven't had a chance to play with it yet (just looked at your example code), but this looks like it's exactly what we were looking for. Will dig a bit deeper later today.