From: <ovi...@jb...> - 2005-05-17 21:08:14
|
Tim wrote: anonymous wrote : | | Further to the discussion regarding asynchronous ACKs, here are some thoughts on how we can implement QueueBrowsing on the core classes and how it all works together. | | The assumption here is that we want to be able to browse any messages in a queue where delivery has not been attempted. We don't want to browse those messages where the message has been delivered but the JMS client has NACKed it. | | Currently the core classes don't allow us to distinguish those messages that have not had delivery attempted and those that have. | | A proposal would be modify the return value of Receiver.handle() from a boolean to one of three states: | | ACK - the message has been handled sychronously and acknowledged. | NACK-DeliveryAttempted - the message is not (yet) acknowledged but delivery is being attempted. | NACK-DeliveryNotAttempted - the message is not acknowledged and delivery has not been attempted. | | The acknowledgement store would also be modified to allow us to distinguish between NACK-DeliveryAttempted and NACK-DeliveryNotAttempted. I.e. it needs to store the tuple <receiver_id, message_id, nack_type (- one of delivery attempted or delivery not attempted)> | | For the case of a queue: | | If the queue has no consumers and messages arrive, nacks are stored with state NACK-DeliveryNotAttempted and the messages are stored. | | The QueueBrowser will only browse NACKed messages with state NACK-DeliveryNotAttempted, so it sees these messages. | | A consumer is now added to the queue, causing deliver() to be triggered. Messages with either of the two NACK states are sent for delivery. The consumer starts to accept messages for delivery, returning NACK-DeliveryAttempted to the router. | | A QueueBrowser will not see the messages with state NACK-DeliveryAttempted. | View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878102#3878102 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3878102 |