0 Replies Latest reply on Mar 21, 2006 7:18 AM by krubin

    A J2EE client, that listens on three different queues, using

    krubin

      Hello All,

      Is it possible and reasonable to set up a single session from a J2EE client, that listens on three different queues, using three message listeners? My understanding is that
      each listener will share the 1 thread.

      I am trying to avoid using stateful session beans.

      Below is a fragment of code to setup 1 listener on a session. I would create additional consumers and message listeners to do this if reasonable.

      Thank you!!!

      Ken

      connection = connectionFactory.createConnection();
      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      replyQueue = session.createTemporaryQueue();
      consumer = session.createConsumer(replyQueue);
      consumer.setMessageListener(new HRListener());
      connection.start();