Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Invalid
-
2.18.1
-
None
-
None
-
Unknown
Description
You can inject a producer template, but not a consumer template. We should add support for the latter as well.
For example a little swarm unit test
@RunWith(Arquillian.class) @DefaultDeployment public class WildFlySwarmCamelTest { @Inject private CamelContext camelContext; @Inject @Uri("seda:inbox") private ProducerTemplate producer; @Inject @Uri("seda:outbox") private ConsumerTemplate consumer; @Test public void testSeda() throws Exception { // send to the seda inbox queue producer.sendBody("Hello Swarm"); // use 5 second timeout to receive the message from outbox Object body = consumer.receiveBody("seda:outbox", 5000); // expect it was the message we sent assertEquals("Hello Swarm", body); } }
Will fail due the consumer template cannot be injected from CDI
Attachments
Issue Links
- relates to
-
CAMEL-9811 camel-cdi - Add support for consumer template injection
- Resolved