4 Replies Latest reply on Jun 27, 2007 1:18 PM by ssuyamboo

    durable subscriber setup

    ssuyamboo

      Hi
      I am trying to establish publish-durable subscriber using jboss 4.0.3 SP1.
      Though I was able to publish messages to topic , my subscriber couldn't read the messages from topic. Are there any preconfigurations to follow to setup durable subscriber?

      I added the required topic to jbossmq-destinations-service.xml

      As per the jboss documentation , I ran the following program before running publisher and subscriber.

      public class DurableTopicSetup
      {

      public static void main(String args[]) throws Exception
      {
      Properties props = new Properties();
      props.setProperty("java.naming.provider.url", "jnp://localhost:1099");
      props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
      props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      InitialContext iniCtx = new InitialContext( props );

      System.out.println("Begin DurableTopicSetup");
      //InitialContext iniCtx = new InitialContext();
      Object tmp = iniCtx.lookup("ConnectionFactory");
      TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
      TopicConnection conn = tcf.createTopicConnection("john", "needle");
      Topic topic = (Topic) iniCtx.lookup("topic/ecommOrder");
      //Topic topic = (Topic) iniCtx.lookup("topic/testDurableTopic");
      TopicSession session = conn.createTopicSession(false,
      TopicSession.AUTO_ACKNOWLEDGE);
      TopicSubscriber recv = session.createDurableSubscriber(topic, "order topic");
      conn.close();
      System.out.println("End DurableTopicSetup");
      System.exit(0);
      }

      }

      Can anyone guide me with steps needed to establish durable subscriptions?

      Thanks
      Sundar