My Route Looks like :
onException(Exception.class).markRollbackOnlyLast();
            from("timer://" + "yr" +"?         
fixedRate=true&period=10").transacted("PROPAGATION_REQUIRES_NEW").bean(cool,
"someBusinessLogic");

ANd The someBusinessLogic is :

 public void someBusinessLogic() {
        // loop to empty queue
                if(getMutex()){
        while (true) {
                
            String msg = consumer.receiveBody("activemq:queue.inbox", 3000,
String.class);
            if (msg == null) {
                // no more messages in queue
                                releaseMutex();
                break;
            }
 
            // do something with body
            msg = "Hello " + msg;
 
            // send it to the next queue
            producer.sendBodyAndHeader("activemq:queue.foo", msg, "number",
count++);
                
        }
                }
    }

what i want to achieve is once i get the mutex , i consume all the messages
from the queue .
and if something goes wrong i only want rollback the last Message and not
the other ones.




--
View this message in context: 
http://camel.465427.n5.nabble.com/MuTex-Polling-tp5755703.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to