8 Replies Latest reply on Aug 6, 2003 7:26 AM by adrian.brock

    MDB on remote queue

    segerss

      Hi

      I am trying to connect an MDB to a queue located on another server, using JBoss 3.2. On deployment I get this exception, which is repeated every xx seconds.

      javax.jms.InvalidDestinationException: The destination QUEUE.mqTest1 does not exist !
      at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:135)
      at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationManager.java:611)
      at org.jboss.mq.server.JMSServerInterceptorSupport.subscribe(JMSServerInterceptorSupport.java:296)
      at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecurityInterceptor.java:150)
      at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.java:677)
      at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:298)
      at org.jboss.mq.il.jvm.JVMServerIL.subscribe(JVMServerIL.java:315)
      at org.jboss.mq.Connection.addConsumer(Connection.java:1082)
      at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:73)
      at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:113)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:562)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:579)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1079)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$1.run(JMSContainerInvoker.java:591)

      There does exist a queue names queue/mqTest1 on the remote machine (if I specify another name I get a NameNotFoundException).

      Here are some details about the testapp:
      The mdb:
      ejb-jar.xml:
      <message-driven >
      [CDATA[]]
      <display-name>MQTest1 MDB1</display-name>

      <ejb-name>ejb/mqTest1/MDB1</ejb-name>

      <ejb-class>qmtest1.Test1MDB</ejb-class>

      <transaction-type>Container</transaction-type>
      <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      <message-driven-destination>
      <destination-type>javax.jms.Queue</destination-type>
      <subscription-durability>NonDurable</subscription-durability>
      </message-driven-destination>

      </message-driven>

      jboss.xml:
      <message-driven>
      <ejb-name>ejb/mqTest1/MDB1</ejb-name>
      <destination-jndi-name>/queue/mqTest1</destination-jndi-name>
      </message-driven>

      Modifications to the 'all' configuration:
      deploy/jms/jms-ds.xml: added:

      RemoteJMSProvider

      org.jboss.jms.jndi.JBossMQProvider

      burgundy:1099
      java:/XAConnectionFactory
      java:/XAConnectionFactory


      conf/standardjboss.xml:
      Replaced
      RemoteJMSProvider
      with
      RemoteJMSProvider
      in the message-driven-bean invoker-proxy-binding.

      The queue (deployed on burgundy):

      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager


        • 1. Re: MDB on remote queue
          wesgere

          In jboss.xml, change the destination-jndi-name to just mqTest1 instead of /queue/mqTest1

          • 2. Re: MDB on remote queue
            wesgere

            Also change these values in jms-ds.xml:

            UIL2ConnectionFactory
            UIL2ConnectionFactory

            The important part is getting rid of the "java:/" in front, which is only valid for local jndi lookups. The change to UIL2 is for performance - it's a better invocation layer. See jbossmq-service.xml for details. In the unlikely case you must have two-phase commit transactions, you can use the UIL2XAConnectionFactory instead.

            • 3. Re: MDB on remote queue
              wesgere

              Actually, I just was getting this problem on linux, and it was fixed by editing the hosts file (/etc/hosts) on the server. Instead of this:
              127.0.0.1 vin-linux-01 localhost
              remove the host name from the loopback line, and add a line mapping the hostname to the external ip address:
              127.0.0.1 localhost
              192.168.2.224 vin-linux-04

              Also, One of my above replies is wrong in suggesting removing the "queue/" from the destination-jndi-name in jboss.xml. Leave that the way you had it (although you can remove the leading '/'. I would use "queue/mqTest1"

              • 4. Re: MDB on remote queue
                dharmon

                Assume MDB on appserver2 wishes to subscribe to a topic on appserver1. Also appserver2 has other MDBs that use topics local to appserver2. Question: what configuration changes do I need to make in order to get ths functioanlity for jboss 3.0.6?

                Based on the steps described in the previous post, my MDB is now receiving messages published to the remote topic on appserver1. However, I have other local topics on appserver2 and by making the following change:

                conf/standardjboss.xml:
                Replaced
                DefaultJMSProvider
                with
                RemoteJMSProvider
                in the message-driven-bean invoker-proxy-binding.

                all my other topics and queues defined on this 2nd app server are now trying to also use the remote JMS provider and I want it to use the default JMS provider. What configuartion changes will I need to do in order for this to have 1 MDB subscribe to a remote topic and other MDBs subscribe to local topics?

                • 5. Re: MDB on remote queue

                  Don't change it in standardjboss.xml

                  Change it per mdb in a jboss.xml

                  Regards,
                  Adrian

                  • 6. Re: MDB on remote queue
                    dharmon

                    Thanks! I'll add a

                    <container-configuartion>
                    <container-name>Standard Message Driven Bean
                    </container name>
                    ...
                    <container-invoker-conf>
                    MyJMSProvider

                    ...
                    to my jboss.xml deployment descriptor specifying the JMS provider I want to use. Thanks again.

                    • 7. Re: MDB on remote queue
                      cuonglam

                      When I start the remote jboss, I keep getting:

                      javax.jms.JMSSecurityException: Connection not authorized to do durable subscription on topic: aoe_topic

                      How do I set up the security on the remote jboss?
                      Is there any way to turn off the authorization of users (for jbossMQ) ?

                      • 8. Re: MDB on remote queue

                        The security is defined in two files.
                        jbossmq-destinations.xml specifies the roles and
                        privileges for each destination.
                        jbossmq-state.xml defines which users are in which
                        roles.

                        Regards,
                        Adrian