Has anyone successfully integrated IBM's MQSeries with JBoss MDB? I'd be very interested and appreciative of any feedback. I anxiously await the "production quality" release of JBossMQ ... but unfortunately, I can't afford to wait. :( If not MQSeries, what other messaging servers has anyone integrated with JBoss MDB? Once again, thanks for any feedback!
I add this:
<!-- The MQSeries provider loader -->
<container-name>MQSeries Message Driven Bean</container-name>
<!-- CMT -->
<!-- BMT -->
And into jboss.xml:
<configuration-name>MQSeries Message Driven Bean</configuration-name>
Where is the mistake?
Thanks for your help.
I've managed to get a test system put together that uses MQSeries instead of JBoss MQ. Seems to work fine but its just a proof of concept for a development project so I have not done any major testing on it yet.
These are the things I needed to do.
1. Write a new MQSeriesProvider class which is almost identical to the existing JBossMQProvider.
2. I don't have LDAP so I used the sun filesystem context provider and integrated this with JBoss using the external context provider support. MQSeries JMSAdmin does not support jnp so I couldn't use that.
3. Add a config entry to jboss.jcml to set the DefaultJMSProvider to MQSeriesProvider.
Because of JBoss's excellent external context support, this is actually much easier to do than described in this thread. I spent a lot of time working on an implementation as described in this thread when it dawned on me that I might be able to leverage the external context support.
Mind you, I've only done a proof-of concept -- nothing "full-blown". I did this using 3.0.0beta2.
I used the file system reference implementation JNDI provider to store my MQSeries administered objects. Refer to the MQSeries for Java support pack (MA-88) if you need information on how to do this.
I copied the following files from the MQSeries java lib directory to the JBoss lib directory:
I added the following to the jboss-service.xml file in the conf directory:
My local.props file (also in the conf directory) contains:
Then I was able to look up the administered objects using standard JNDI lookups.
Unfortunately a code change is required to use a message-driven bean to access MQSeries. The org.jboss.ejb.plugins.jms.JMSContainerInvoker class prefixes all JNDI names to it with "topic/" or "queue/" depending on the destination type specified in the EJB deployment descriptor. Remove this and re-build and it works like a charm.
I wrote this mostly from memory so I may have missed something along the way, but you should get the general idea.
Here is how I got MQSeries to work with JBoss. Unfortunately it was MQseries 5.1 (it does not support XA transactions with JMS untill 5.2).
Any way - here were the basic steps - assumes that you already have MQSeries installed and have configured a queue manager and a queue.:
1. Install MQSeries JMS supportPac (you can download from www.ibm.com - for solaris the file is called ma88_sol.tar.Z)
2. Use the MQSeries JMSAdmin tool to create a QueueConnectionFactory object and a Queue object in the sun file system JNDI (you can use ldap if you have and ldap server - The JMS support pack has the provider for sun file system and ldap - also MQSeries JMS only supports 3 JNDI providers - sun ldap, sun file system and websphere).
set the values in the JMSAdmin.config to something like
2.1 here are the commands I used to configure the QueueConnectionFactory and a queues. Note: You need to configure the queues to be found below a queue sub context - this is because of a bug/feature of jboss
run the JMSAdmin tool and enter the following commands
InitCtx> def qcf(QueueConnectionFactory) qmanager(queue_manager_name)
InitCtx> def ctx(queue)
InitCtx> change ctx(queue)
InitCtx/queue> def q(RequestQueue) qmanager(queue_manager_name) queue(queue_name)
Note: the values queue_name and queue_manager_name should be replaced with the appropriate values for your environment. i.e.
queue_name = SYSTEM.DEFAULT.LOCAL.QUEUE
queue_manager_name = QMGR1
3. Use some of the sample programs in the MQSeries JMS supportPac to verify your configuration.
Now the jboss config stuff.
4. Create a custom adapter - all i did was change the class name of the initial context factory in the JBossMQProvider class. (Suggestion to the Maintainers of JBossMQ - make the initial context factory configurable from the JMS provider loader mbean - no custom class would be needed then.)
5. Create an external JNDI context
The external.fs.props file was placed in $JBOSS_DIST/conf/default and contained
Note: these values are the same as those in step 4.
6. Configure your default JMS provider to use your custom class (also make sure that you have the StdJMSPool mbean loaded)
Note: the ProviderUrl values is the same as in step 4 and 7
7. If everything is working then when you start jboss you should not get any errors.
8. Write your message driven bean. Here is an example jboss.xml deployment descriptor i used for the above configuration
8.1 Here is a jboss.xml deployment descriptor for an ejb using 2 queues
Anyway, hope this is useful. It worked for me.