4 Replies Latest reply on Jul 23, 2003 3:10 AM by 130g

    Durable subscriber not recieving messages

    130g

      Hiya folks

      I am having a problem with dissapearing messages!
      I have a publisher that publishes messages to a topic, on that topic I have registered a durable subscriber...so far so good :)
      I can see (in the console) that messages are retained in the topic untill the durable subscriber connects...well actually untill the subscriber starts it's session. And then the messages just dissapears without the subscriber receiving any of them...

      Any ideas as to where the messages escapes to?

      My setup...
      jbossmq-state.sql:

      EmailerBean
      emailer
      DurableNdsmsEmailTopic

      ...

      DurableNdsmsEmailTopic
      ndsmsEmailTopic


      subscriber:
      TopicConnectionFactory conFactory = (TopicConnectionFactory) ctx.lookup("ConnectionFactory");
      connection = conFactory.createTopicConnection("EmailerBean", "emailer");
      ses = connection.createTopicSession(false, javax.jms.Session.CLIENT_ACKNOWLEDGE);
      Topic topic = (Topic) ctx.lookup("topic/ndsmsEmailTopic");
      TopicSubscriber subscriber = ses.createDurableSubscriber(topic, "DurableNdsmsEmailTopic");
      connection.start();
      Message m = subscriber.receiveNoWait();
      while(m != null) {
      processMessage(m);
      m.acknowledge();
      m = subscriber.receiveNoWait();
      }

        • 1. Re: Durable subscriber not recieving messages

          Your config is not correct, it should be something like:



          DurableNdsmsEmailTopic <!-- matches id from client -->
          DurableNdsmsEmailTopic <!-- matches subscription name -->
          ndsmsEmailTopic



          I don't see how messages could be retained with your config?

          Regards,
          Adrian

          • 2. Re: Durable subscriber not recieving messages
            130g

            Thank you Adrian for your answer!

            Duno about the retaining bit, maybe the purge/clean is only done when a connection is made and started?
            I determin the amount of messages in the topic by the DurableMessageCount attribute in the MBean view, is that the correct way?

            Anyway I tried you configuration change so that the jbossmq-state.xml is now:



            EmailerBean
            emailer
            DurableNdsmsEmailTopicClient



            <snip is this important?>



            DurableNdsmsEmailTopicClient
            DurableNdsmsEmailTopic
            ndsmsEmailTopic




            And it behaves exactly the same, the messages are retained (as seen by DurableMessageCount) untill I makes and starts a connection with the EmailerBean and then the messages are gone without me recieving any of them...

            btw I run on Jboss-3.2.1

            • 3. Re: Durable subscriber not recieving messages

              Can you enable TRACE logging for org.jboss.mq
              and check the server log.

              I suspect you will find a message from the state manager
              that says it is re-registering the subscription because
              it does not match the configured subscription.

              Do you get the same problem if you don't add the config
              to jbossmq-state.xml and create the subscription from
              the client when it first subscribes?

              Regards,
              Adrian

              • 4. Re: Durable subscriber not recieving messages
                130g

                Duh!!! Why didnt I think of checking the trace output...

                The trace output stated that the messages was dropped because of timeout. The timeout value of the message was Long.MAX_VALUE so I am not sure why the messages was timed out, but it worked when I set timeout value to 14 days...

                Thank you for the help!