1 Reply Latest reply on Aug 28, 2002 1:39 PM by Peter Hall

    Topics work, Queues don't

    Peter Hall Newbie

      I've got some Jboss3.0.0 code that works using a Topic. Now I've change the publisher (MDB) and subscriber (external process) to use a queue instead, however nothing appears at the Receiver. Messages are sent ok, and the receiver finds the ConnectionFactory and the queue fine (i.e. no exceptions), just no messages, either using MessageListener interface, or doing an explicit receiver.receive();

      I suspect a config problem, so I enclose the Queue config from my XXX-service.xml:


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










      But it could be my client:

      String connectionFactory = "java:/ConnectionFactory";

      String queueName = "queue/OGD";

      Context ctx = null;
      try
      {
      ctx = new InitialContext(); // ETCUtil.getInitialContext();
      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(connectionFactory);
      connection_ = factory.createQueueConnection();
      session_ = connection_.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      }
      catch(NamingException ne)
      {
      throw new ETCException(ne, "Failed to lookup the Connection Factory '" + connectionFactory + "'");
      }
      catch(JMSException je)
      {
      throw new ETCException(je, "Failed to create the Inbound Queue Connection or the Session!");
      }

      try
      {
      Object obj = ctx.lookup(queueName);
      if (obj == null) throw new ETCException("Failed to lookup the queue '" + queueName + "'");
      queue_ = (Queue)PortableRemoteObject.narrow(obj, Queue.class);
      }
      catch (NamingException ne)
      {
      System.out.println("Failed to lookup queue '" + queueName + "'");
      throw new ETCException(ne, "Failed to lookup the queue '" + queueName + "'");
      }

      try
      {
      receiver_ = session_.createReceiver(queue_);
      // receiver_.setMessageListener(this);
      connection_.start();

      // does onMessage get called??
      }
      catch(JMSException jms)
      {
      // System.out.println(jms.toString());
      throw new ETCException(jms, "Failed to setup the JMS queue listener for internal updates!");
      }


      tia,

      HJ