1 Reply Latest reply on Oct 17, 2003 1:26 PM by Adrian Brock

    Sending Reply Message from MDB in JBOSS

    rg Newbie

      Hello,

      I have an MDB in JBOSS server from which I need to send a reply message to a queue on an external JMS provider. I have the required configuration in jboss.xml, standardjboss.xml and another service.xml and I am able to receive messages in MDB from the external provider.

      For sending reply message:

      i) How do I get initialcontext, do I need to explicitly create it pointing to external JMS provider in my MDB so as I can create QueueConnectionFactory etc. to send the reply back?

      ii) In my ejb-jar.xml, what sort of entries will be there in resource-ref?

      iii) What sort of entries will I need to make in jboss.xml?

      Here is my current jboss.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">

      <enterprise-beans>
      <message-driven>
      <ejb-name>QueueTextMessageBean</ejb-name>
      <destination-jndi-name>queue1</destination-jndi-name>
      <invoker-bindings>

      <invoker-proxy-binding-name>remote-message-driven-bean</invoker-proxy-binding-name>

      </invoker-bindings>
      </message-driven>
      </enterprise-beans>


      Thanks,
      RG.

        • 1. Re: Sending Reply Message from MDB in JBOSS
          Adrian Brock Master

          You create a resource-ref for the connection factory
          and queue.

          ejb-jar.xml
          <resource-ref>
          A Queue ConnectionFactory
          <res-ref-name>jms/MyQueueConnection</res-ref-name>
          <res-type>javax.jms.QueueConnectionFactory</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>
          <resource-ref>
          A Queue
          <res-ref-name>jms/QueueName</res-ref-name>
          <res-type>javax.jms.Queue</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>

          jboss.xml
          <message-driven>
          <ejb-name>whatever</ejb-name>
          <resource-ref>
          <res-ref-name>jms/MyQueueConnection</res-ref-name>
          <resource-name>queuefactoryref</resource-name>
          </resource-ref>
          <resource-ref>
          <res-ref-name>jms/QueueName</res-ref-name>
          <resource-name>queueref</resource-name>
          </resource-ref>
          </message-driven>

          <resource-managers>
          <resource-manager>
          <res-name>queuefactoryref</res-name>
          <res-jndi-name>jnp://remotehost:1099/ConnectionFactory</res-jndi-name>
          </resource-manager>
          <resource-manager>
          <res-name>queueref</res-name>
          <res-jndi-name>jnp://remotehost:1099/queue/testQueue</res-jndi-name>
          </resource-manager>

          I show accessing another jboss server using jnp.

          Regards,
          Adrian