You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Matt Sicker <bo...@gmail.com> on 2014/07/15 18:38:53 UTC

How does bean integration work in non-Spring contexts?

Suppose I'm using CDI, or Blueprint, or Guice, or really anything other
than Spring. The documentation <
http://camel.apache.org/bean-integration.html> doesn't really explain how
this works. Do things just work automatically?

-- 
Matt Sicker <bo...@gmail.com>

Re: How does bean integration work in non-Spring contexts?

Posted by Manav Kher <ic...@gmail.com>.
Not true. @BeanInject, @PropertyInject etc. DO WORK in blueprint. I've used
it.


-Manav

On Tue, Jul 15, 2014 at 3:51 PM, Charlie Mordant <cm...@gmail.com>
wrote:

> I'm pretty sure annotations won't work with blueprint, but I think you can
> use beanRef("myBean") camel Java dsl (sorry, I missed the annotation part
> of the question).
>
> If you want to compare a bp vs a CDI versions of a camel module, here's a
> path to the same module made both ways:
>
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.samples/net.osgiliath.hello/net.osgiliath.hello.routes
>
> My preference (in the OSGI world) is for blueprint as is it more mature
> than the CDI one.
>
> Regards,
>
>
>
> 2014-07-15 21:41 GMT+02:00 Matt Sicker <bo...@gmail.com>:
>
> > Right, but does @BeanInject, @EndpointInject, etc., all work in
> Blueprint?
> > Or do you still have to manually wire everything together in Blueprint?
> >
> >
> > On 15 July 2014 14:38, Charlie Mordant <cm...@gmail.com> wrote:
> >
> > > Hi Matt,
> > >
> > > camel-blueprint also makes blueprint beans working with camel.
> > >
> > > Regards,
> > >
> > >
> > > 2014-07-15 20:09 GMT+02:00 Matt Sicker <bo...@gmail.com>:
> > >
> > > > So I'm guessing in order for it to work in OSGi using services, it
> > would
> > > > require a bit of additional code?
> > > >
> > > > I'll take a look at the CDI stuff, though, as we're considering using
> > it
> > > > instead of Blueprint for our routes.
> > > >
> > > >
> > > > On 15 July 2014 13:01, Claus Ibsen <cl...@gmail.com> wrote:
> > > >
> > > > > Hi
> > > > >
> > > > > Yes these are Camel annotations and there is some code in
> camel-core
> > /
> > > > > camel-spring / camel-guice / camel-cdi to inject and support these
> > > > > annotations in those environments.
> > > > >
> > > > > Though camel-cdi is a bit special as its using some cdi extension
> and
> > > > > whatnot. And it could use a little cdi love to be improved/better.
> > > > >
> > > > > On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com>
> > wrote:
> > > > > > Suppose I'm using CDI, or Blueprint, or Guice, or really anything
> > > other
> > > > > > than Spring. The documentation <
> > > > > > http://camel.apache.org/bean-integration.html> doesn't really
> > > explain
> > > > > how
> > > > > > this works. Do things just work automatically?
> > > > > >
> > > > > > --
> > > > > > Matt Sicker <bo...@gmail.com>
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Claus Ibsen
> > > > > -----------------
> > > > > Red Hat, Inc.
> > > > > Email: cibsen@redhat.com
> > > > > Twitter: davsclaus
> > > > > Blog: http://davsclaus.com
> > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > > hawtio: http://hawt.io/
> > > > > fabric8: http://fabric8.io/
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Matt Sicker <bo...@gmail.com>
> > > >
> > >
> > >
> > >
> > > --
> > > Charlie Mordant
> > >
> > > Full OSGI/EE stack made with Karaf:
> > > https://github.com/OsgiliathEnterprise/net.osgiliath.parent
> > >
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>
>
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>



-- 
-M Kher

Re: How does bean integration work in non-Spring contexts?

Posted by Matt Sicker <bo...@gmail.com>.
Is that what the <contextScan/> element is for?

Also, I'm looking for ways to use Camel that don't depend on Spring in
order to maintain forward OSGi compatibility. Spring Boot et al. are
practically the opposite of OSGi, so it doesn't seem like such a smart idea
to use it when one intends on staying modular.


On 15 July 2014 14:51, Charlie Mordant <cm...@gmail.com> wrote:

> I'm pretty sure annotations won't work with blueprint, but I think you can
> use beanRef("myBean") camel Java dsl (sorry, I missed the annotation part
> of the question).
>
> If you want to compare a bp vs a CDI versions of a camel module, here's a
> path to the same module made both ways:
>
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.samples/net.osgiliath.hello/net.osgiliath.hello.routes
>
> My preference (in the OSGI world) is for blueprint as is it more mature
> than the CDI one.
>
> Regards,
>
>
>
> 2014-07-15 21:41 GMT+02:00 Matt Sicker <bo...@gmail.com>:
>
> > Right, but does @BeanInject, @EndpointInject, etc., all work in
> Blueprint?
> > Or do you still have to manually wire everything together in Blueprint?
> >
> >
> > On 15 July 2014 14:38, Charlie Mordant <cm...@gmail.com> wrote:
> >
> > > Hi Matt,
> > >
> > > camel-blueprint also makes blueprint beans working with camel.
> > >
> > > Regards,
> > >
> > >
> > > 2014-07-15 20:09 GMT+02:00 Matt Sicker <bo...@gmail.com>:
> > >
> > > > So I'm guessing in order for it to work in OSGi using services, it
> > would
> > > > require a bit of additional code?
> > > >
> > > > I'll take a look at the CDI stuff, though, as we're considering using
> > it
> > > > instead of Blueprint for our routes.
> > > >
> > > >
> > > > On 15 July 2014 13:01, Claus Ibsen <cl...@gmail.com> wrote:
> > > >
> > > > > Hi
> > > > >
> > > > > Yes these are Camel annotations and there is some code in
> camel-core
> > /
> > > > > camel-spring / camel-guice / camel-cdi to inject and support these
> > > > > annotations in those environments.
> > > > >
> > > > > Though camel-cdi is a bit special as its using some cdi extension
> and
> > > > > whatnot. And it could use a little cdi love to be improved/better.
> > > > >
> > > > > On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com>
> > wrote:
> > > > > > Suppose I'm using CDI, or Blueprint, or Guice, or really anything
> > > other
> > > > > > than Spring. The documentation <
> > > > > > http://camel.apache.org/bean-integration.html> doesn't really
> > > explain
> > > > > how
> > > > > > this works. Do things just work automatically?
> > > > > >
> > > > > > --
> > > > > > Matt Sicker <bo...@gmail.com>
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Claus Ibsen
> > > > > -----------------
> > > > > Red Hat, Inc.
> > > > > Email: cibsen@redhat.com
> > > > > Twitter: davsclaus
> > > > > Blog: http://davsclaus.com
> > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > > hawtio: http://hawt.io/
> > > > > fabric8: http://fabric8.io/
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Matt Sicker <bo...@gmail.com>
> > > >
> > >
> > >
> > >
> > > --
> > > Charlie Mordant
> > >
> > > Full OSGI/EE stack made with Karaf:
> > > https://github.com/OsgiliathEnterprise/net.osgiliath.parent
> > >
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>
>
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>



-- 
Matt Sicker <bo...@gmail.com>

Re: How does bean integration work in non-Spring contexts?

Posted by Charlie Mordant <cm...@gmail.com>.
I'm pretty sure annotations won't work with blueprint, but I think you can
use beanRef("myBean") camel Java dsl (sorry, I missed the annotation part
of the question).

If you want to compare a bp vs a CDI versions of a camel module, here's a
path to the same module made both ways:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.samples/net.osgiliath.hello/net.osgiliath.hello.routes

My preference (in the OSGI world) is for blueprint as is it more mature
than the CDI one.

Regards,



2014-07-15 21:41 GMT+02:00 Matt Sicker <bo...@gmail.com>:

> Right, but does @BeanInject, @EndpointInject, etc., all work in Blueprint?
> Or do you still have to manually wire everything together in Blueprint?
>
>
> On 15 July 2014 14:38, Charlie Mordant <cm...@gmail.com> wrote:
>
> > Hi Matt,
> >
> > camel-blueprint also makes blueprint beans working with camel.
> >
> > Regards,
> >
> >
> > 2014-07-15 20:09 GMT+02:00 Matt Sicker <bo...@gmail.com>:
> >
> > > So I'm guessing in order for it to work in OSGi using services, it
> would
> > > require a bit of additional code?
> > >
> > > I'll take a look at the CDI stuff, though, as we're considering using
> it
> > > instead of Blueprint for our routes.
> > >
> > >
> > > On 15 July 2014 13:01, Claus Ibsen <cl...@gmail.com> wrote:
> > >
> > > > Hi
> > > >
> > > > Yes these are Camel annotations and there is some code in camel-core
> /
> > > > camel-spring / camel-guice / camel-cdi to inject and support these
> > > > annotations in those environments.
> > > >
> > > > Though camel-cdi is a bit special as its using some cdi extension and
> > > > whatnot. And it could use a little cdi love to be improved/better.
> > > >
> > > > On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com>
> wrote:
> > > > > Suppose I'm using CDI, or Blueprint, or Guice, or really anything
> > other
> > > > > than Spring. The documentation <
> > > > > http://camel.apache.org/bean-integration.html> doesn't really
> > explain
> > > > how
> > > > > this works. Do things just work automatically?
> > > > >
> > > > > --
> > > > > Matt Sicker <bo...@gmail.com>
> > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > Email: cibsen@redhat.com
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > hawtio: http://hawt.io/
> > > > fabric8: http://fabric8.io/
> > > >
> > >
> > >
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> > >
> >
> >
> >
> > --
> > Charlie Mordant
> >
> > Full OSGI/EE stack made with Karaf:
> > https://github.com/OsgiliathEnterprise/net.osgiliath.parent
> >
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: How does bean integration work in non-Spring contexts?

Posted by Matt Sicker <bo...@gmail.com>.
Right, but does @BeanInject, @EndpointInject, etc., all work in Blueprint?
Or do you still have to manually wire everything together in Blueprint?


On 15 July 2014 14:38, Charlie Mordant <cm...@gmail.com> wrote:

> Hi Matt,
>
> camel-blueprint also makes blueprint beans working with camel.
>
> Regards,
>
>
> 2014-07-15 20:09 GMT+02:00 Matt Sicker <bo...@gmail.com>:
>
> > So I'm guessing in order for it to work in OSGi using services, it would
> > require a bit of additional code?
> >
> > I'll take a look at the CDI stuff, though, as we're considering using it
> > instead of Blueprint for our routes.
> >
> >
> > On 15 July 2014 13:01, Claus Ibsen <cl...@gmail.com> wrote:
> >
> > > Hi
> > >
> > > Yes these are Camel annotations and there is some code in camel-core /
> > > camel-spring / camel-guice / camel-cdi to inject and support these
> > > annotations in those environments.
> > >
> > > Though camel-cdi is a bit special as its using some cdi extension and
> > > whatnot. And it could use a little cdi love to be improved/better.
> > >
> > > On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com> wrote:
> > > > Suppose I'm using CDI, or Blueprint, or Guice, or really anything
> other
> > > > than Spring. The documentation <
> > > > http://camel.apache.org/bean-integration.html> doesn't really
> explain
> > > how
> > > > this works. Do things just work automatically?
> > > >
> > > > --
> > > > Matt Sicker <bo...@gmail.com>
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > Red Hat, Inc.
> > > Email: cibsen@redhat.com
> > > Twitter: davsclaus
> > > Blog: http://davsclaus.com
> > > Author of Camel in Action: http://www.manning.com/ibsen
> > > hawtio: http://hawt.io/
> > > fabric8: http://fabric8.io/
> > >
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>
>
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>



-- 
Matt Sicker <bo...@gmail.com>

Re: How does bean integration work in non-Spring contexts?

Posted by Charlie Mordant <cm...@gmail.com>.
Hi Matt,

camel-blueprint also makes blueprint beans working with camel.

Regards,


2014-07-15 20:09 GMT+02:00 Matt Sicker <bo...@gmail.com>:

> So I'm guessing in order for it to work in OSGi using services, it would
> require a bit of additional code?
>
> I'll take a look at the CDI stuff, though, as we're considering using it
> instead of Blueprint for our routes.
>
>
> On 15 July 2014 13:01, Claus Ibsen <cl...@gmail.com> wrote:
>
> > Hi
> >
> > Yes these are Camel annotations and there is some code in camel-core /
> > camel-spring / camel-guice / camel-cdi to inject and support these
> > annotations in those environments.
> >
> > Though camel-cdi is a bit special as its using some cdi extension and
> > whatnot. And it could use a little cdi love to be improved/better.
> >
> > On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com> wrote:
> > > Suppose I'm using CDI, or Blueprint, or Guice, or really anything other
> > > than Spring. The documentation <
> > > http://camel.apache.org/bean-integration.html> doesn't really explain
> > how
> > > this works. Do things just work automatically?
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > Email: cibsen@redhat.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> > hawtio: http://hawt.io/
> > fabric8: http://fabric8.io/
> >
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: How does bean integration work in non-Spring contexts?

Posted by Matt Sicker <bo...@gmail.com>.
So I'm guessing in order for it to work in OSGi using services, it would
require a bit of additional code?

I'll take a look at the CDI stuff, though, as we're considering using it
instead of Blueprint for our routes.


On 15 July 2014 13:01, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Yes these are Camel annotations and there is some code in camel-core /
> camel-spring / camel-guice / camel-cdi to inject and support these
> annotations in those environments.
>
> Though camel-cdi is a bit special as its using some cdi extension and
> whatnot. And it could use a little cdi love to be improved/better.
>
> On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com> wrote:
> > Suppose I'm using CDI, or Blueprint, or Guice, or really anything other
> > than Spring. The documentation <
> > http://camel.apache.org/bean-integration.html> doesn't really explain
> how
> > this works. Do things just work automatically?
> >
> > --
> > Matt Sicker <bo...@gmail.com>
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
Matt Sicker <bo...@gmail.com>

Re: How does bean integration work in non-Spring contexts?

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

Yes these are Camel annotations and there is some code in camel-core /
camel-spring / camel-guice / camel-cdi to inject and support these
annotations in those environments.

Though camel-cdi is a bit special as its using some cdi extension and
whatnot. And it could use a little cdi love to be improved/better.

On Tue, Jul 15, 2014 at 6:38 PM, Matt Sicker <bo...@gmail.com> wrote:
> Suppose I'm using CDI, or Blueprint, or Guice, or really anything other
> than Spring. The documentation <
> http://camel.apache.org/bean-integration.html> doesn't really explain how
> this works. Do things just work automatically?
>
> --
> Matt Sicker <bo...@gmail.com>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/