camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Ament" <johndam...@apache.org>
Subject CDI Injection support
Date Mon, 22 Feb 2016 12:40:32 GMT
Hi all,

I was looking at the changes that went into Camel 2.17 with CDI injection
support.  It seems that injection support doesn't work consistently when
done not using an annotated member.

I tried a few different ways:

@Inject
@Any
private Instance<Endpoint> endpointInstance;

...

endpointInstance.select(MockEndpoint.class, new
UriLiteral("mock:outgoing")).get()

Which consistently gives back (in Weld 1.1.x, 2.x, OWB 1.2.x and OWB 1.6.x)
an error that no beans are defined, even though I have that endpoint
defined.

Now, if I try the CDI 1.1 way of using the utility class to look up the
instance, it works fine in Weld 2.x but not OWB 1.6.x.  As far as I know,
this setup should work in both, and since I know I use pattern in other
apps I don't think its a case of a bug in the impl.  I was wondering if any
camel gurus could comment on it?

https://github.com/johnament/camel/commit/05dd5f6f8cda541fedfc68c6f199e014defe3f09

John

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message