Maybe I don't see the whole picture, but why wouldn't you do this in the
processor?
For example:
public void process(Exchange exchange) throws Exception {

    processMessage();
    callWebService(JSON);
    
    do {
        // add some kind of sleep or timer task or anything else
        response = callStatusWebService();
    } while (response == INTERMEDIATE);
}

Another way for this problem would be to have the same process method
followed by another process method:
from("direct:input")
    .process(messageProcessor)
    .to("checkResultRoute");

from("checkResultRoute")
    .process(checkResultProcessor)
    .choice()
    .when(test if result is intermediate)
    .to("checkResultRoute")
    .otherwise()
    .to("destination after you have received the SUCCESS/FAILED response");

This should build a loop.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Loop-in-Camel-Calling-a-service-till-I-receive-required-status-back-tp5743203p5743256.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to