I've read the jms specification and questions by google such as
http://stackoverflow.com/questions/2991412/anyone-know-exactly-which-jms-messages-will-be-redelivered-in-client-acknowledge
. But I still confused about it.
Another question is: how can a consumer tell the broker to
redelevery a message to other consumers(maybe again to this consumer)
e.g. we have some real time tasks and here is code:
class MyConsumer implements MessageListener{
public void onMessage(Message msg) {
doPhrase1();
if(leftTime < avgTime1){
//Tell broker I can't finish it in time,
//you should redelevery to other consumers
//do some cleanup job
}
doPhrase2();
if(leftTime < avgTime1){
//Tell broker I can't finish it in time,
//you should redelevery to other consumers
//do some cleanup job
}
doPhrase3();
}