camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim085 <sim...@hotmail.com>
Subject Re: How to call a route, wait to finish, and ignore any changes when this returns?
Date Mon, 09 Jan 2017 22:12:24 GMT
Hi taariq,

thanks for pointing this out. This worked fine.

[code]
		class KeepOriginalAggregationStrategy implements AggregationStrategy {
		    public Exchange aggregate(Exchange original, Exchange resource) {
		        return original;
		    }
		}
				
		from("seda:A")
			.log("Hello From A")
			.setHeader("MyHeader", constant("A-HEADER"))
			.transform(constant("A-BODY"))
			.enrich("seda:B", new KeepOriginalAggregationStrategy())
			.log("MyHeader is ${in.header.MyHeader}")
			.log("Body is ${body}")
		;
		
		from("seda:B")
			.log("Hello From B")
			.log("MyHeader value frm B is : '${in.header.MyHeader}'")
			.setHeader("MyHeader", constant("B-HEADER"))
			.transform(constant("B-BODY"))
			.log("Ready from B")
		;
[/code]

Result:

[(camel-1) thread #0 - seda://A] route2                         INFO  Hello
>From A
[(camel-1) thread #1 - seda://B] route3                         INFO  Hello
>From B
[(camel-1) thread #1 - seda://B] route3                         INFO 
MyHeader value frm B is : 'A-HEADER'
[(camel-1) thread #1 - seda://B] route3                         INFO  Ready
from B
[(camel-1) thread #0 - seda://A] route2                         INFO 
MyHeader is A-HEADER
[(camel-1) thread #0 - seda://A] route2                         INFO  Body
is A-BODY





--
View this message in context: http://camel.465427.n5.nabble.com/How-to-call-a-route-wait-to-finish-and-ignore-any-changes-when-this-returns-tp5792288p5792339.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message