camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bengt Rodehav <>
Subject Use simple language from within a processor
Date Thu, 14 Oct 2010 12:41:09 GMT
I have a configurable camel route for monitoring certain directories. I use
the quartz component to perform my monitoring actions at certain scheduled
times (e g to check that a certain file exists in a certain directory at a
certain time).

I configure my route by giving it the directory to monitor (and a few other
things). However, what directory to monitor depends on what day it is. E g
files that are processed are moved to an archive directory with a
subdirectory name with today's date ( e g ./archive/20101014).

I perform my actual monitoring in a custom processor. I would like to
configure this using the simple language, e g like this:

# Directory to monitor


I've been using the simple language before as part of the route. However, I
don't know how I can evaluate a simple language expression (like the
directory property above) from within my custom processor. Can anyone help
with this? My code is similar to the following:

from("quartz://" + group + "/" + timerName + "?cron=" + cron).process(new
> ConditionProcessor(condition, mDirectory));


public class ConditionProcessor implements Processor {

  private ICondition mCondition;

  private String mDirectory;

>   public ConditionProcessor(ICondition theCondition, String theDirectory) {

    mCondition = theCondition;

    mDirectory = theDirectory;


>   public void process(Exchange theExchange) throws Exception {

    String evaluatedDirectory = ???; // Evaluate "theDirectory" with simple
> language

    if (!mCondition.check(evaluatedDirectory)) {

      // Send notification




I'm using Camel 2.4 now but will update to Camel 2.5 when it's available.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message