camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim085 <>
Subject Re: Can't understand what inOnly is doing
Date Tue, 27 Sep 2016 15:09:20 GMT
@Ranx, I had another look at your code. I have changed the code a little and
ran the test again. From what I can see the SEDA endpoint acts correctly to
the InOut and InOnly ExchangePattern, i.e. - acts asynchronously when called
with InOnly and synchronously when called with InOut.

Changed code and reproduced below:

import org.apache.camel.ExchangePattern;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class AsynchTest extends CamelTestSupport { 
	protected RouteBuilder createRouteBuilder() throws Exception { 
		return new RouteBuilder() { 
			public void configure() { 

					.log("AAA: Current Message is '${body}'");

					.log("BBB: Current Message is '${body}'");
	@Produce(uri = "direct:AAA") 
	protected ProducerTemplate producer; 
	@Test public void fireAndForget() { 
		 * This logs:
		 * INFO  AAA: Current Message is 'AAA_FAF'
		 * INFO  BBB: Current Message is 'BBB'

	@Test public void requestReply() { 
		String result = (String) producer.requestBody("AAA_RR"); 
		System.out.println("Result: "+ result); 
		 * This logs:
		 * INFO  BBB: Current Message is 'BBB'
		 * INFO  AAA: Current Message is 'BBB'
		 * Result: BBB

Ranx wrote
> If you look at the Unit test I posted earlier on that thread or even
> copy/paste it into a test class and run it you'll notice that the
> sub-route
> invocation behavior changes depending on whether the initial invocation of
> the very first endpoint is fire and forget or request/reply.  

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message