2 Replies Latest reply on Feb 27, 2004 6:41 AM by null null

    Mini-Howto: MDB listens on remote topic hosted by another jb

    jieshengz Newbie

      Suppose you have two JBoss instances. Instance A hosts the JMS.
      Instance B hosts the MDB. The above rule still apply.
      You need to modify the jbossmq-state.xml and jbossmq-destinations-server.xml associated with instance A.
      The ejb.jar containing ejb-jar.xml and jboss.xml is deployed to instance B.

      Right now, we need to configure the instance B to listen the JMS hosted by A for this particular MDB.

      1. configure instance B to listen on the JMS hosted by A
      Add this mbean to $JBOSS/server/default/deploy/jms/jms-ds.xml

      <attri bute name="ProviderName">RemoteJMSProvider</attri bute>
      <attri bute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attri bute>
      <!-- instance A IP and JNDI port -->
      <attri bute name="ProviderUrl"></attri bute>
      <!-- this JBOSS instance will connect the remote JMS server through the
      OILServerILService invocation layer or UILServerILService invocation layer.
      This connection is defined in the remote server's $JBOSS/server/default/deploy/jms/oil-service.xml
      or uil2-service.xml
      Use UIL2XAConnectionFactory first since UIL does not need to open socket back to client. There is no
      firewall implication.

      After you succeed with UIL, you can try OIL.
      <attri bute name="QueueFactoryRef">UIL2XAConnectionFactory
      <attri bute name="TopicFactoryRef">UIL2XAConnectionFactory


      2. use this JMSProvider for this MDB.

      edit the jboss.xml associated together with the MDB. In this example file, the MDB uses a special
      invoker which connects to remote JMS.


      <!-- use the remote JMS provider -->
      <JMS ProviderAdapterJNDI>RemoteJMSProvider</JMS ProviderAdapterJNDI>
      <Server SessionPoolFactoryJNDI>StdJMSPool</Server SessionPoolFactoryJNDI>
      <Maximum Size>15</Maximum Size>
      <Max Messages>1</Max Messages>
      <MDB Config>
      <Re connectIntervalSec>10</Re connectIntervalSec>
      <DLQ Config>
      <Destination Queue>queue/DLQ</Destination Queue>
      <Max TimesRedelivered>10</Max TimesRedelivered>
      <Time ToLive>0</Time ToLive>
      </DLQ Config>
      </MDB Config>