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

2018-08-16 Thread Claus Ibsen (JIRA)


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

Claus Ibsen commented on CAMEL-12520:
-

That is because you use an exchange, which is intended for the send method 
only, and not for request. We can add a check for this invalid use-cases and 
have the template fail

> 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
>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)


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

2018-05-22 Thread Steve Storck (JIRA)

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

Steve Storck commented on CAMEL-12520:
--

I actually think this is a bug, rather than an improvement, because the fluent 
API offers this as an operation, but the operation does not work.

> 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: Luca Burgazzoli
>Priority: Minor
> Fix For: 2.22.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)


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

2018-05-22 Thread Steve Storck (JIRA)

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

Steve Storck commented on CAMEL-12520:
--

I have also thought of another possible solution.  If an exchange is passed in 
with this method, the constituent parts of the exchange could be set on the 
{{FluentProducerTemplate}} – the properties, headers, body, etc, rather than 
setting the {{Exchange}} instance itself on the template.  I realize that it 
would not be the same exchange, but I wonder if it will really matter...

> FluentProducerTemplate.withExchange() does not seem to send exchange
> 
>
> Key: CAMEL-12520
> URL: https://issues.apache.org/jira/browse/CAMEL-12520
> Project: Camel
>  Issue Type: Bug
>  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: Luca Burgazzoli
>Priority: Minor
> Fix For: 2.22.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)


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

2018-05-22 Thread Steve Storck (JIRA)

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

Steve Storck commented on CAMEL-12520:
--

It wouldn't normally be a big deal, but since it's a fluent API, it suggests 
that such a thing will work. If it is easier to remove/hide the 
{{.withExchange()}} method from the fluent API, that sounds like a reasonable 
solution, too.  Do you have any documentation or any recollection why the 
{{.withExchange()}} method was added in the first place?

> FluentProducerTemplate.withExchange() does not seem to send exchange
> 
>
> Key: CAMEL-12520
> URL: https://issues.apache.org/jira/browse/CAMEL-12520
> Project: Camel
>  Issue Type: Bug
>  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: Luca Burgazzoli
>Priority: Minor
> Fix For: 2.22.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)


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

2018-05-21 Thread Luca Burgazzoli (JIRA)

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

Luca Burgazzoli commented on CAMEL-12520:
-

So the DefaultFluentProducerTemplate uses a ProducerTemplate under the hood 
that does not have a method to achieve what you describe, let me see if such 
method can be added.

> FluentProducerTemplate.withExchange() does not seem to send exchange
> 
>
> Key: CAMEL-12520
> URL: https://issues.apache.org/jira/browse/CAMEL-12520
> Project: Camel
>  Issue Type: Bug
>  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: Luca Burgazzoli
>Priority: Minor
> Fix For: 2.22.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)


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

2018-05-17 Thread Steve Storck (JIRA)

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

Steve Storck commented on CAMEL-12520:
--

It appears that DefaultFluentProducerTemplate does not care about the exchange 
that was set by .withExchange() when request() is called.  Instead, if I use 
.send(), the proper response is in the incoming message body.  Is this by 
design?  If so, then the documentation should be updated, but it seems like it 
is odd behavior for an otherwise very nice API.

> FluentProducerTemplate.withExchange() does not seem to send exchange
> 
>
> Key: CAMEL-12520
> URL: https://issues.apache.org/jira/browse/CAMEL-12520
> Project: Camel
>  Issue Type: Bug
>  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
>Priority: Major
> 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)