From: <ad...@jb...> - 2005-05-06 13:15:50
|
You are missing the point. 1) You don't need to wait for the message to land on the client 2) The acks/nacks can come back at any time - including transactionally (based on the client's acknowledgement policy) 3) Don't trust the client to give you *any* acks/nacks or in the correct order, or duplicates or any assumptions about correctness by the client. Instead, what you need to do is deliver the message to something on the serverside that you do trust. This can then *asynchronously* send the messages the client and *asynchronously* wait for the acks/nacks coming back from the client. If the client does it wrong, you know this from your "something". If the client crashes, you know what you need to NACK. If the client closes the session without nacking, you know what you need to NACK. If the client does it wrong, you have a mechanism to trap the problem and not just follow the misbehaving client blindly. If the transaction manager unilaterally rollsback the transaction, you know what you need to NACK. etc.... I called this something the Client service in the original design. In JBossMQ, it is a combination of the ClientConsumer/BasicQueue-acknowledgement maps. This does not discount the ability to optimize some paths, e.g. MessageConsumer.receiveNoWait() but they are optimizations - synchronous behaviour the core path should be aimed at asynchronous throughput. Indeed on the throughput side, you could even do "ReadAhead" to message listeners whereby when you start the message listener, it sends N messages rather than just one. http://jira.jboss.com/jira/browse/JBAS-1343 Of course, that is something the user needs to be able to configure. Or the "Something" can be more tolerant of connection failures and hold state allowing the client to reconnect transparently "Persistent Connections": http://jira.jboss.com/jira/browse/JBAS-1345 View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3876757#3876757 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3876757 |