[GLASSFISH-19492] MDB @MessageDriven listens on Topic for @JMSDestinationDefinition className="javax.jms.Queue" Created: 03/Jan/13 Updated: 06/Jan/13 Resolved: 06/Jan/13
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Please see Arun's async receiver sample (which is currently commented as not working in the following blog link) and analysis in
|Comment by Nigel Deakin [ 03/Jan/13 ]|
I have tried this in the debugger and agree that this appears to be the problem.
If you define a MDB which uses mappedName to refer to a queue resource created in the normal way (e.g. using glassfish-resources.xml) then ActivationSpec.setDestinationType() is called with a value of "javax.jms.Queue".
However if you define a MDB which uses mappedName to refer to a queue resource created using a @JMSDestinationDefinition annotation then ActivationSpec.setDestinationType() is NOT called. As a result the MDB creates a consumer on a topic (but the correct physical name).
So this seems to be an issue specifically with resources created using a @JMSDestinationDefinition annotation.
There is a workaround, which is to explicitly specify the destinationType activation property. Note that setting this property should not be necessary.
|Comment by arungupta [ 03/Jan/13 ]|
Tried the workaround in my simple sample and it worked.
|Comment by Simon Meng [ 05/Jan/13 ]|
Assume we create a jms destination resource via the following command:
In an application (a MDB), it also defines a jms destination by annotation
@JMSDestinationDefinition(name = "jms/myQueue",
@MessageDriven(mappedName = "jms/myQueue")
When deploy a MDB, we need use the mappedName to find jms destination resource in domain.xml or EJbMessageBeanDescriptor. I need know the clear answer for the following questions:
1. If the mappedName does not start with "java:" prefix, whether need add "java:comp/env" prefix to match the resources.
|Comment by Simon Meng [ 06/Jan/13 ]|
Fixed at revision 57990.