Following is the route :

public class MyRouteBuilder extends RouteBuilder {
 @Override
 public void configure() throws Exception {
      // xnc route here
  String xncFileSupport = ICEndPoints.getValue(XNC_FILE_SUPPORT);
  if (XNC_SUPPORT_ON.equalsIgnoreCase(xncFileSupport)) {
   try {
    InProcessor inproc = new InProcessor();
    String rootXncFolder = ICEndPoints.getRootXNCFolder();
      String sourceFolder =  getXNCSourceURI(pollDelayParameter,rootXncFolder);
    AgentAuthProcessor authProc = new AgentAuthProcessor();
    ConfigurationUtils utils = ConfigurationUtils.getInstance();
    Configuration config = utils.getConfig();
    String agentUserPwdUrl = MyUtils.getAgentUserPwdUrl(utils, config);
    // xnc route starts here
    from(sourceFolder)
    // the exception clause here
    .onException(Exception.class)
    .maximumRedeliveries(redeliveryCount)
    .redeliveryDelay(redeliveryDelay)
    .logHandled(true)
    .logRetryStackTrace(stackValue)
    .retryAttemptedLogLevel(LoggingLevel.WARN)
    .retriesExhaustedLogLevel(LoggingLevel.ERROR)
    .backOffMultiplier(2.0)
    .handled(true)
    .to(SEDA_XNC_EXCEPTION)
    .end()
    .process(pickupProc)
    .choice()
       .when(header(Constants.GATEWAY_AUTH_VALUE).isEqualTo(true))
       .process(authProc)
       .to(agentUserPwdUrl)
       .otherwise()
       .process(authProc)
       .end()
    .process(inproc)
    .recipientList(header(Constants.DESTINATION_URI))
    .process(new CommandResponseProcessor()) // try using xpath here also


  }
 }
}


I want to repeat the following steps from the route  based on a condition:

 .choice()
.when(header(Constants.GATEWAY_AUTH_VALUE).isEqualTo(true))
.process(authProc)
.to(agentUserPwdUrl)
.otherwise()
.process(authProc)
.end()
.process(inproc)
.recipientList(header(Constants.DESTINATION_URI))

Iam using camel 2.4 , can you please suggest me how to repeat the above steps 
from the route based on a condition.

Thanks,
Chandana


Reply via email to