messaging
messaging copied to clipboard
Allow async delivery to temporary destinations in Java EE
Currently there is no (legal) way for an application running in the Java EE web or EJB containers to consume messages asynchronously from a temporary queue or topic.
The use of setMessageListener to register a MessageListener is not permitted.
It is not possible to configure a MDB to consume messages from a temporary destination.
This was raised in the GlassFish forum recently. https://www.java.net//node/900071 Is this a common requirement?
It is proposed that the discussion elsewhere to make async message delivery in Java EE applications more flexible should (at least) consider this requirement.
Affected Versions
[2.0]
- Issue Imported From: https://github.com/javaee/jms-spec/issues/141
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: Unassigned
@glassfishrobot Commented Reported by @nigeldeakin
@glassfishrobot Commented lprimak said: The primary pattern that uses temporary queues and asynchronous receivers is gathering cluster nodes' health pattern.
- all nodes broadcast a heartbeat on a topic with a temporary queue as jmsReplyTo
- all nodes reply to the heartbeat message using getJMSReplyTo() from the heartbeat message (to the temp queue)
- thus, all nodes will know all other nodes, and will remove stale nodes on heartbeat timeout.
This is the simplest way to implement this pattern.
Another pattern that uses this method is here: http://www.drdobbs.com/jvm/asynchronous-java-calls-part-2/240003830
@glassfishrobot Commented Issue-Links: is related to JMS_SPEC-146
@glassfishrobot Commented This issue was imported from java.net JIRA JMS_SPEC-141