0 Replies Latest reply on Dec 18, 2003 9:55 AM by Rudi Vankeirsbilck

    MDB and durable topics

    Rudi Vankeirsbilck Newbie

      Hi all,

      I want a Message Driven Bean that subscribes to a durable topic. From the documentation (jbossbook321.pdf) I have picked up a few examples but the examples that work with durable topics do not relate to MDBs.

      Since the publisher has got nothing to do with the durability aspect of the topic, I am assuming that I only need to modify the MDB itself.
      Since as a MDB developer, I am only providing the onMessage method, I am assuming (correctly?) that JBoss is setting up the TopicSubscriber for me and all I need to do is tell JBoss that I want a durable TopicSubscriber by calling the createDurableSubscriber method on the TopicSession.

      Have I got that right?

      Therefore, I have added the following line to my ejb-jar.xml:

      but this is giving me the following error:
      15:21:51,053 WARN [JMSContainerInvoker] JMS provider failure detected:
      javax.jms.JMSException: Null or empty subscription
      at org.jboss.mq.SpyConnection.createDurableConnectionConsumer(SpyConnection.java:112)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:586)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:674)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)

      I think JBoss is telling me that I haven't supplied a username, password and a name that uniquely identifies the subscription. Only, where do I specify that?
      Another question regarding the subscription identifier. Since there will probably be more than one instance of the MDB subscribing to the same topic, I think JBoss should actually use the beans hash code as this is the only thing that distinguishes instances of the same MDB no?

      Is there anybody that can help me with that.