camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kondalarv <kondala.sou...@gmail.com>
Subject Content Based Router : Java DSL is not working
Date Mon, 25 May 2015 07:33:28 GMT
I have choice with many options, and using java operation for conditions. 
The route is going to otherwise() option always and checckFilePattern()
method is not executing.


from(FILE_WATCHER_DSL)
		 .log(LoggingLevel.INFO, FileWatchDSLUtil.getFileLogPattern())			 
		 .choice()
		 
.when(checckFilePattern(header("CamelFileAbsolutePath").toString())).process(new
FileConsumerProcesser()).endChoice()	 	
		 	.otherwise().log("File Patten is not Matched. ${file:absolute.path}")
		 	  .to("file:/app/work01/FileWatcherAgent/quarantine").process(new
FileConsumerErrorProcesser()).stop().endChoice()
		 .end()
		 .log("End Processing Route");
		;


private static Predicate checckFilePattern(String fileName){	
	logger.info("checckFilePattern==> File Name : {}", fileName);
	boolean flag = false;
	if(fileName.endsWith("txt")) flag= true;
	Predicate predicate =  PredicateBuilder.constant(flag);
	logger.info("checckFilePattern==> predicate: {}", predicate);
	return predicate;
	}



--
View this message in context: http://camel.465427.n5.nabble.com/Content-Based-Router-Java-DSL-is-not-working-tp5767440.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message