camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10733) camel-cdi - Allow to @Inject a ConsumerTemplate
Date Fri, 03 Mar 2017 11:24:45 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894176#comment-15894176
] 

Claus Ibsen commented on CAMEL-10733:
-------------------------------------

Ah thanks then we can close this one 

> camel-cdi - Allow to @Inject a ConsumerTemplate
> -----------------------------------------------
>
>                 Key: CAMEL-10733
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10733
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cdi
>    Affects Versions: 2.18.1
>            Reporter: Claus Ibsen
>            Assignee: Antonin Stefanutti
>            Priority: Minor
>
> 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
> {code}
> @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);
>     }
> }
> {code}
> Will fail due the consumer template cannot be injected from CDI



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message