camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ankelee <>
Subject Testing and dynamic filenames.
Date Tue, 13 Apr 2010 09:06:08 GMT


Using Camel 2.3.0 SNAPSHOT I've made a route where I use a wireTap to back
up any incoming files and timestamp the filename like so:

from("file://" + props.getProperty("directory.incoming"))
		.wireTap("file://" + props.getProperty("directory.incoming.backup")+
"?fileName=${in.header.backupFileName}")...and so on.

I want to test that the backups are created and would like to do something
like this:

		String filename;
		RouteDefinition route = context.getRouteDefinition("processing");
		route.adviceWith(new RouteBuilder() {
			public void configure() throws Exception { 
				intercept().process(new Processor() {
					public void process(Exchange ex) throws Exception {
						filename = ex.getIn().getHeader("backupFileName", String.class);

Obviously this doesn't work since 'filename' is out of scope for the
Processor. Can I access the header using normal Java or do you have any
ideas how to do this? Maybe I have to reconsider how to test the backup
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message