messaging
messaging copied to clipboard
Add methods to get a Destination.
Currently, the JMS API has no clear way of looking up a Queue or Topic. It's typically assumed to use JNDI, however when you're in Java SE there is no single entry point that allows one to look up a Queue or Topic.
Typically, permanent Queues/Topics are created via configuration (XML files, metadata, etc). As a result, I think we should add methods to ConnectionFactory/JMSContext/Connection that allows a developer to get a destination.
Affected Versions
[2.0]
- Issue Imported From: https://github.com/javaee/jms-spec/issues/135
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: Unassigned
@glassfishrobot Commented Reported by genomeprjct
@glassfishrobot Commented genomeprjct said: This may be as simple as clarifying that createQueue/createTopic should/should not be specific to temporary queues/topics. Looking at two open implementations (OpenMQ and HornetQ), one allows this to return temporary destinations, the other does not.
@glassfishrobot Commented chris.barrow said: Methods createTemporaryQueue and createTemporaryTopic are provided for temporary destinations. AFAIK createQueue and createTopic are for non-temporary destinations. Many JMS providers allow these to be used to create new (dynamic) queues and topics. Their function is "get or create", so they can be used instead of doing a JNDI lookup.
@glassfishrobot Commented @nigeldeakin said: The methods createQueue and createTopic provide a way for an application to obtain a Queue or Topic object identified by the specified name.
These methods are not intended to create the underlying queue or topic in the JMS provider but are simply ways of obtaining a Queue or Topic object which refers to an existing queue or topic.
(I know some JMS providers do support automatic creation of queues and topics but this is not a requirement of these methods.)
Can you say more about why these methods do not meet your needs? Are you asking for methods to physically create the queue or topic in the JMS provider?
@glassfishrobot Commented This issue was imported from java.net JIRA JMS_SPEC-135