Assume we create a jms destination resource via the following command:
asadmin create-jms-resource --restype javax.jms.Queue --property Name=myQueue jms/myQueue
The resource should be created successfully. It appears in domain.xml
In an application (a MDB), it also defines a jms destination by annotation
@JMSDestinationDefinition(name = "jms/myQueue",
resourceAdapterName = "jmsra",
className = "javax.jms.Queue",
@MessageDriven(mappedName = "jms/myQueue")
public class MessageReceiverAsync implements MessageListener
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.
2. If two jms destination resources have the same name (name does not start with "java:" prefix), the two resources are defined in both domain.xml and application, which resource should be used.