I have been struggling with this for a long time now. I have an IBM Websphere MQ, which uses EJB and MDB
The following is where the ejb mdb is configured.
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://websphere.ibm.com/xml/ns/javaee"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd" version="1.0">
<message-driven name="Queue1MDB">
<jca-adapter activation-spec-binding-name="jms/Queue1MQActivationSpec" destination-binding-name="jms/Queue1RequestQueue"/>
<resource-ref binding-name="jms/QueueConnectionFactory" name="jms/QueueConnectionFactory"/>
<message-destination-ref binding-name="jms/SuccessfulResponseQueue" name="jms/SuccessfulResponseQueue"/>
<message-destination-ref binding-name="jms/FailedResponseQueue" name="jms/FailedResponseQueue"/>
</message-driven>
<message-driven name="Queue2MDB">
<jca-adapter activation-spec-binding-name="jms/Queue2MQActivationSpec" destination-binding-name="jms/Queue2RequestQueue"/>
<resource-ref binding-name="jms/QueueConnectionFactory" name="jms/QueueConnectionFactory"/>
<message-destination-ref binding-name="jms/SuccessfulResponseQueue" name="jms/SuccessfulResponseQueue"/>
<message-destination-ref binding-name="jms/FailedResponseQueue" name="jms/FailedResponseQueue"/>
</message-driven>
<message-driven name="Queue3MDB">
<jca-adapter activation-spec-binding-name="jms/Queue3MQActivationSpec" destination-binding-name="jms/Queue3RequestQueue"/>
<resource-ref binding-name="jms/QueueConnectionFactory" name="jms/QueueConnectionFactory"/>
<message-destination-ref binding-name="jms/SuccessfulResponseQueue" name="jms/SuccessfulResponseQueue"/>
<message-destination-ref binding-name="jms/FailedResponseQueue" name="jms/FailedResponseQueue"/>
</message-driven>
<message-driven name="Queue4MDB">
<jca-adapter activation-spec-binding-name="jms/Queue4MQActivationSpec" destination-binding-name="jms/Queue4RequestQueue"/>
<resource-ref binding-name="jms/QueueConnectionFactory" name="jms/QueueConnectionFactory"/>
<message-destination-ref binding-name="jms/SuccessfulResponseQueue" name="jms/SuccessfulResponseQueue"/>
<message-destination-ref binding-name="jms/FailedResponseQueue" name="jms/FailedResponseQueue"/>
</message-driven>
</ejb-jar-bnd>
This is configured in ear, which is deployed in IBM WAS. The destination-binding-name will pick the corresponding queue details from the IBM WAS.
And later, my configuring the MDB in my java class like below, the listening is achieved on all the queues simultaneously and the messages are picked up:
@Resource(name = "jms/QueueContractConnectionFactory")
private ConnectionFactory connectionFactory;
@Resource(name = "jms/FailedResponseQueue")
private Queue errorQueue;
@Resource(name = "jms/SuccessfulResponseQueue")
private Queue responseQueue;
I now have to remove the ejb and modify the mdb configurations to make it deploy-able in tomcat.
The xml is something, which I literally have no idea on how to map it without the ejb parameters.
Can someone help or share a document on how to achieve this? I would like to have a example of IBM MQ to Spring JMS with Activation Spec.
Thanks in advance.