I have a simple MDB:
@MessageDriven(mappedName = "jms/TestQueue", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
})
public class NewMessageBean implements MessageListener {
@Resource(name = "testProperty")
String prop;
public NewMessageBean() {
}
@Override
public void onMessage(Message message) {
TextMessage tm = (TextMessage) message;
try {
System.out.println("MDB says " + tm.getText() + " - " + prop);
} catch (JMSException ex) {
Logger.getLogger(NewMessageBean.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
jms/TestQueue exists in the server, and it's Physical Destination Name is TestQueue.
I have the following ejb-jar.xml
If I comment out the @Resource, and remove the ejb-jar.xml, the MDB works just fine.
If I add in the ejb-jar.xml, and the @Resource, an odd thing happens.
Specifically, my jms/TestQueue Physical Destination Name is changed to "PhysicalQueue". At this point, the MDB "fails" as it's no longer listening to the proper queue. The JMS server, indeed, has a "PhysicalQueue".
The @Resource at this point is a red herring since the MDB is not being invoked (since I'm posting to the wrong queue).
I have the "metadata-complete" set to false, though that should be the default anyway. It doesn't seem right that the ejb-jar.xml should be stomping on the destination configured in the server.
This is Payara Server 5.192 #badassfish (build 115).
Regards,
Will Hartung