1 2 3 Previous Next 79 Replies Latest reply on Jul 23, 2003 6:56 AM by quentin

    MQSeries/JBoss MDB/3rd Party Messaging

    franktv

      Hello all.

      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!

      - Frank

        • 1. Re: MQSeries/JBoss MDB/3rd Party Messaging
          hchirino

          Hi,
          I add this:

          jms-ds.xml:

          <!-- The MQSeries provider loader -->

          MQSeriesProvider

          org.jboss.jms.jndi.JBossMQProvider

          QueueConnectionFactory
          java:/XAConnectionFactory


          standardjboss.xml:

          <invoker-proxy-binding>
          MQmessage-driven-bean
          <invoker-mbean>default</invoker-mbean>
          <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
          <proxy-factory-config>
          MQSeriesProvider
          StdJMSPool
          15
          1
          True

          10

          queue/DLQ
          10
          0


          </proxy-factory-config>
          </invoker-proxy-binding>

          .....
          .....
          <container-configuration>
          <container-name>MQSeries Message Driven Bean</container-name>
          <call-logging>false</call-logging>
          <invoker-proxy-binding-name>MQmessage-driven-bean</invoker-proxy-binding-name>
          <container-interceptors>
          org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor
          org.jboss.ejb.plugins.LogInterceptor
          org.jboss.ejb.plugins.RunAsSecurityInterceptor
          <!-- CMT -->
          org.jboss.ejb.plugins.TxInterceptorCMT
          org.jboss.ejb.plugins.MetricsInterceptor
          org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
          <!-- BMT -->
          org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
          org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT
          org.jboss.ejb.plugins.MetricsInterceptor
          org.jboss.resource.connectionmanager.CachedConnectionInterceptor
          </container-interceptors>
          <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
          <instance-cache></instance-cache>
          <persistence-manager></persistence-manager>
          <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
          <container-pool-conf>
          100
          </container-pool-conf>
          </container-configuration>


          And into jboss.xml:



          <enterprise-beans>

          <message-driven>
          <ejb-name>enlaceMQBean</ejb-name>
          <configuration-name>MQSeries Message Driven Bean</configuration-name>
          <destination-jndi-name>queue/MQqueue</destination-jndi-name>
          </message-driven>

          </enterprise-beans>

          <resource-managers>
          </resource-managers>



          Where is the mistake?

          Thanks for your help.

          Mario.

          • 2. Re: Configuring and Using WebLogic as a JMS provider from wi

            For the n thousandth time, you need to get access to weblogic's jndi.
            If you discover how to do this, please post the result, nobody else does.

            Regards,
            Adrian

            • 3. Re: MQSeries/JBoss MDB/3rd Party Messaging
              sjb

              Frank,
              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.

              Simon

              • 4. Re: MQSeries/JBoss MDB/3rd Party Messaging

                Do you mean this works for MDB to?

                This could be something for the contrib module then.

                //Peter

                • 5. Re: MQSeries/JBoss MDB/3rd Party Messaging

                  I would recomend you to pose the question on the lold JBossMQ list, since it is where the JBossMQ guys still hang out.

                  //Peter

                  • 6. Re: MQSeries/JBoss MDB/3rd Party Messaging

                    Ohps, sorry. Wrong topic.

                    //Peter

                    • 7. Re: MQSeries/JBoss MDB/3rd Party Messaging
                      sjb

                      Yes. My tests were for MDB, it works fine.

                      Simon

                      • 8. Re: MQSeries/JBoss MDB/3rd Party Messaging
                        hchirino

                        Could you please add this to the contrib section??? I would love to play with this.

                        • 9. Re: MQSeries/JBoss MDB/3rd Party Messaging
                          lolo2000

                          Hi,

                          do you need to install mqseries 's classes ? or it can works only with a MQSeriesProvider ?
                          Is there an example of MQSeriesProvider ?

                          Thanks

                          • 10. Re: MQSeries/JBoss MDB/3rd Party Messaging
                            rajsaini

                            Hi,

                            Can you please pulish the JMSAdpater writeen for MQSeries.

                            Thanks

                            • 11. Re: MQSeries/JBoss MDB/3rd Party Messaging
                              smishra

                              Hi:

                              Would you kindly share the implementation.
                              Thanks.

                              • 12. Re: MQSeries/JBoss MDB/3rd Party Messaging
                                haberg



                                Did the implementation get contributed/shared in some way? I would be very interested in taking a look at the config/customized adapter.

                                /Henrik.

                                • 13. Re: MQSeries/JBoss MDB/3rd Party Messaging
                                  pcallies

                                  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:
                                  com.ibm.mq.jar
                                  com.ibm.mqjms.jar
                                  com.ibm.mqbind.jar
                                  fscontext.jar
                                  jms.jar
                                  providerutil.jar

                                  I added the following to the jboss-service.xml file in the conf directory:

                                  external/fs/mqjndi
                                  local.props
                                  javax.naming.InitialContext


                                  My local.props file (also in the conf directory) contains:
                                  java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
                                  java.naming.provider.url=file:///mqjndi

                                  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.

                                  • 14. Re: MQSeries/JBoss MDB/3rd Party Messaging
                                    conora

                                    Hi,

                                    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
                                    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
                                    PROVIDER_URL=file:///jndiRoot

                                    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)

                                    InitCtx/queue> end

                                    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

                                    external/fs
                                    external.fs.props
                                    javax.naming.InitialContext


                                    The external.fs.props file was placed in $JBOSS_DIST/conf/default and contained

                                    java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
                                    java.naming.provider.url=file:///jndiRoot

                                    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)


                                    DefaultJMSProvider
                                    org.jboss.jms.jndi.JBossMQSeriesProvider
                                    file:///jndiRoot
                                    QueueConnectionFactory
                                    QueueConnectionFactory


                                    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


                                    <enterprise-beans>
                                    <message-driven>
                                    <ejb-name>MDBean</ejb-name>
                                    <destination-jndi-name>RequestQueue</destination-jndi-name>
                                    <resource-ref>
                                    <res-ref-name>jms/QCF</res-ref-name>
                                    <jndi-name>external/fs/QueueConnectionFactory</jndi-name>
                                    </resource-ref>
                                    </message-driven>
                                    </enterprise-beans>




                                    8.1 Here is a jboss.xml deployment descriptor for an ejb using 2 queues


                                    <enterprise-beans>

                                    <ejb-name>Requester</ejb-name>
                                    <resource-ref>
                                    <res-ref-name>jms/QCF</res-ref-name>
                                    <jndi-name>external/fs/QueueConnectionFactory</jndi-name>
                                    </resource-ref>
                                    <resource-ref>
                                    <res-ref-name>jms/queue/RequestQueue</res-ref-name>
                                    <jndi-name>external/fs/queue/RequestQueue</jndi-name>
                                    </resource-ref>
                                    <resource-ref>
                                    <res-ref-name>jms/queue/ReplyQueue</res-ref-name>
                                    <jndi-name>external/fs/queue/ReplyQueue</jndi-name>
                                    </resource-ref>

                                    </enterprise-beans>


                                    Anyway, hope this is useful. It worked for me.

                                    Conor

                                    1 2 3 Previous Next