Try using listener ports:
This is a discussion on How to link MQ 7.0 to a WAS 6.1 project for the use of MDB - Websphere ; Hallo, my WAS 6.1 application has to send messages to a MQ V7.0 and read messages from this MQ system. To send messages I provide a SessionBean that connects to a MQ-Queue. In order to receive messages I want to ...
my WAS 6.1 application has to send messages to a MQ V7.0 and read messages from this MQ system.
To send messages I provide a SessionBean that connects to a MQ-Queue.
In order to receive messages I want to provide a MessageDriven Bean that also listens to a MQ-Queue. In a first test my MDB should listen to the same queue where the SessionBean is sending to.
I have installed MQ V7.0 as a test version. There is a MQ sample with a queue-manager called 'QM_entwgf' and a queue called 'postcard' that I want to use in my first tests.
My *first approach* using WAS 6.1 *„WebSphere MQ messaging provider“*:
In WAS 6.1 I used the Resources/JMS/WebSphere MQ messaging provider.
In the connection factory for queues -settings i set the following values:
channel:S_entwgf (a value that I found in the MQ-Explorer)
CCSID:850(a value that I found in the MQ-Explorer)
I also added a queue with the following values:
name of the basis queue: postcard
name of the basis queue-manager: QM_entwgf
With this settings I can connect with my SessionBean and send messages to the queue. This messages can be seen in the MQ-explorer.
But to receive messages I have to use a MessageDriven Bean (MDB).
To deploy a MDB in WAS 6.1 the links to the MDB must be specified in the ibm-ejb-bnd.xml file.
As I understood to fill the information for the ibm-ejb-bnd.xml there must be a 'activation-specification' in the WAS. This activation specification cannot be made in WAS 6.1 for WebSphere MQ messaging provider.
*Is it really not possible to use MDBs with the WebSphere MQ messaging provider?*
So I made a *second approach*:
I followed the ibm redbook chapter 6.
Here the connection to the Messaging engine is made using the WAS 6.1 *„Default messaging provider“*. There is made also a „activation-specification“. This activation-specification is used to link the MDB.
The example worked fine but it doesn't use MQ.
So I really guess: *How can I link a WAS 6.1 - activation-specification to a MQ instance?*
Try using listener ports:
thank you for your fast answer.
I created the Message Listener according to Your link.
But to deploy my MDB I still need a actitavtion-specification to be set in the ibm-ejb-bnd.xml.
Could you point to me the deployment-decriptors and/or the binding file (ibm-ejb-bnd.xml) for a MDB that will be linked via Message Listener?
Thanks a lot,
You could use "Websphere MQ Link" within WAS to link WAS and MQ. Then default provider and activation spec isn't a problem.
Setup is something like this:
So for you mq link in WAS:
sender channel: host: port:
sender channel: connection:
Remote queue: remote queue name remote queue manager:
On the Bus in WAS add the destination with a type of queue.
Set up QCF, Queues, and Activation Spec in WAS in the default provider.
I would advise against using the MQ link in this case as listener ports will give you exactly what you want with less configuration and performance overhead.
I thought his question was about using activation specification with Websphere MQ? Listener ports will not give him activiation specification will it?
Yes, there is a performance overhead using MQ Link, but he doesn't indicate performance is an issue or what the message size is.
Infocenter has detailed information for choosing how to interoperate with Websphere MQ and what the implications are.
I was just giving options :-)
I have struggled for two days, trying to produce the right configuration files for my EJB 3.0 MDB-Bean.
May be the example you showed fits to EJB 2.1 but not to EJB 3.0, as it is an **.xmi* – extension?
I guess I found the 'Deployment Description Editor' in RAD at least. In my case I have got a quite simple binding-file called ibm-ejb-jar-bnd.xml:
and a ejb-jar.xml:
I deployed the EAR with these configuration-files but I got a exception like:
com.ibm.ejs.container.EJBConfigurationException: REQUIRED_BINDING_NOT_FOUND for MDB: SimpleMessageBean
Now I am wondering:
*1.Am I right that I should use a ibm-ejb-jar-bnd.xml file instead of xmi extension?*
*2.If I am right, what information is missing in the binding file to get the MDB deployed?*
I try, to get a very simple example running. I don't mind which linking method will be used. So my question was to both, SI-Bus technique and Listener ports.
In the moment I don't care about performance, but of course coding a real app one day it may be important...
Thanks to you both!
I was using a wrong ejb-jar.xml file with a mis typed name for the MDB. I didn't use exactly the file I was posting because I also used a Session Bean. The posted files were right!
Now I can deploy this small application, and the MDB receives a message that is sent to the corresponding MQ-channel.
So it is right:
For EJB 3.0 linking a MDB via Listener Ports you have to use a ejb-jar.xml and a ibm-ejb-jar-bnd.xml like shown above!
It is not necessary to make a .xmi-file.
It is a pity that I couldn`t find a documentation to the syntax of ibm-ejb-jar-bnd.xml that explained the use of listener ports. The solution is so easy....
Thanks to you all!
Because I was struggling for several days to find this solution I decided to show here the complete source codes of the beans the configuration files and a detailed description, how to configure the WAS.
example: MDB with listener ports
The example is in German.