camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From duncanto <>
Subject Re: How to make a copy an Exchange in a Route segment
Date Thu, 09 Jan 2014 15:09:28 GMT
Thanks for your suggestions .. which Ive tried but without success ... 

Ill clarify the problem with some noddy route code ..  


context.addRoutes(new RouteBuilder() {
			public void configure() throws Exception {

				from("direct:start").setBody().constant("outer body")
						   	// !!!! Is there a DSL definition I can add here to create a copy
of the message exchange
						    // passed to the fooRoute and protect the outer exchange  ???? 
						   .removeHeaders("*", "foo")   // remove all but keep the foo header
						// dont want the bar header to be removed at this point  
						// dont want message body changed in the fooRoute to be in scope here  
						.log( "main flow - foo header is : ${}")
						.log( "main flow - bar header is : ${}")
						.log( "main flow - body is : ${body}")
				.setBody().constant("foo body")
				// ok :o) with bar header being removed 
				.log( "foo flow - foo header is : ${}")
				.log( "foo flow - bar header is : ${}")
			    .log( "foo flow - body is : ${body}")
				.log("foo route finished")
				// continue with further processing etc etc 

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

View raw message