3 Replies Latest reply on Apr 8, 2002 4:03 AM by Peter Antman

    ConnectionConsumer and MDB

    francesco calderini Newbie

      Does anybody know how exactly MessageConsumer instances are associated to MDBs in JBoss? Is it like that for each deployed MDB a new TopicConnection is created and a new ConnectionConsumer is associated with it ?


        • 1. Re: ConnectionConsumer and MDB
          Peter Antman Expert

          Here is the meat from src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java:

          // create a queue connection
          Object qFactory = context.lookup(adapter.getQueueFactoryRef());
          QueueConnection qConnection =
          (qFactory, user, password);
          connection = qConnection;

          // lookup or create the destination queue
          Queue queue =
          "queue/" + jndiSuffix,

          // set up the server session pool
          pool = createSessionPool(qConnection,
          true, // tx
          new MessageListenerImpl(this));
          log.debug("server session pool: " + pool);

          // create the connection consumer
          connectionConsumer = qConnection.

          So, yes, for every deployed MDB there is one connection, one consumer and one pool and several sessions (managed by the pool and the consumer).


          • 2. Re: ConnectionConsumer and MDB
            Stephen Mahony Newbie

            .. but how does the MDB/Container Know which Queue to lookup if the Queue if remote..,e.g. if I want multiple MDB on remote clients to subscribe to single Queue instance on another remote JBoss server?


            • 3. Re: ConnectionConsumer and MDB
              Peter Antman Expert

              Thats decided by the JMSProviderAdapter, see the docs.