messaging
messaging copied to clipboard
Ambiguous javadocs for Connection.createConnectionConsumer and createDurableConnectionConsumer
The JMS 1.1 javadocs for Connection.createConnectionConsumer lists the following possible exceptions:
JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector. InvalidDestinationException - if an invalid destination is specified. InvalidSelectorException - if the message selector is invalid.
The JMS 1.1 javadocs for Connection.createDurableConnectionConsumer lists the following possible exceptions:
JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector. InvalidDestinationException - if an invalid destination is specified. InvalidSelectorException - if the message selector is invalid.
So what exception is thrown if a invalid message selector is supplied? An InvalidSelectorException (since the message selector is invalid) or a JMSException (invalid argument for messageSelector).
Since a InvalidSelectorException is a subtype of JMSException then it would be safe to return a InvalidSelectorException, but the javadocs as they stand are contradictory.
Affected Versions
[1.1]
- Issue Imported From: https://github.com/javaee/jms-spec/issues/75
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: Unassigned
@glassfishrobot Commented Reported by @nigeldeakin
@glassfishrobot Commented @nigeldeakin said: This didn't make it into JMS 2.0 and so is carried forward to JMS 2.1.
@glassfishrobot Commented This issue was imported from java.net JIRA JMS_SPEC-75