You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2018/08/16 08:46:00 UTC

[jira] [Resolved] (CAMEL-12520) FluentProducerTemplate.withExchange() does not seem to send exchange

     [ https://issues.apache.org/jira/browse/CAMEL-12520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-12520.
---------------------------------
    Resolution: Fixed

> FluentProducerTemplate.withExchange() does not seem to send exchange
> --------------------------------------------------------------------
>
>                 Key: CAMEL-12520
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12520
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.19.2, 2.19.3, 2.19.4, 2.19.5, 2.20.0, 2.20.1, 2.20.2, 2.20.3, 2.21.0
>         Environment: Linux and Java 8 or Java 9
>            Reporter: Steve Storck
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.23.0
>
>         Attachments: MessageApplication.java
>
>
> When I use the following simple but complete code example:
> {code:java}
> public static void main(String[] args) throws Exception {
>     CamelContext camelContext = new DefaultCamelContext();
>     camelContext.start();
>     camelContext.addRoutes(new RouteBuilder() {
>         @Override
>         public void configure() {
>             from("direct-vm:start").process(exchange -> {
>                 String incoming = exchange.getIn().getBody(String.class);
>                 exchange.getIn().setBody("Message received: " + incoming, String.class);
>             });
>         }
>     });
>     Exchange exchange = ExchangeBuilder.anExchange(camelContext)
>             .withBody("Hello!")
>             .withPattern(ExchangePattern.InOut)
>             .build();
>     System.out.println(
>             camelContext.createFluentProducerTemplate()
>             .withExchange(exchange)
>             .to("direct-vm:start")
>             .request(String.class)
>     );
> }{code}
> The message body appears to be missing, as indicated in the program output:
> {code:java}
> Message received: null{code}
> I have tried this with java 1.8 and 1.9, and with camel 2.19.2 and 2.21.1, and both camel versions exhibit the same behavior when run with both java versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)