4 Replies Latest reply on Jun 13, 2011 7:54 PM by Dan Rush

    Jboss 5.1.0.GA JMS topic acts like a queue

    Dan Rush Newbie

      I've been porting my apps from JBoss 4.2.3.GA to JBoss 5.1.0.GA and I'm down to my last error (hopefully). I have a JMS topic configured that works just fine in 4.2.3.GA.  I have multiple subscribers and only one of my subscribers will receive the published message. So it acts like a queue.  Here is my configuration:

       

        <mbean code="org.jboss.jms.server.destination.TopicService"

            name="jboss.messaging.destination:service=Topic,name=MyTopic"

            xmbean-dd="xmdesc/Topic-xmbean.xml">

            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

            <depends>jboss.messaging:service=PostOffice</depends>

            <attribute name="JNDIName">jms/MyTopic</attribute>

         </mbean>

       

      Here's jboss log on startup:

      15:10:30,217 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1b4e5b0 started

      15:10:30,217 INFO  [TopicService] Topic[jms/MyTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000

       

      Here's my client code that works great as a standalone java program connecting to jboss, but I have it in a war file now:

       

                  InitialContext iniCtx = null;

                 

                  if(m_isStandAlone) {

                      iniCtx = new InitialContext();

                  } else {

                      iniCtx = JMSUtil.getInitialContext(APPSERVER_INITIAL_CONTEXT_FACTORY, m_providerUrl, m_username, m_password, null);

                  }

       

                  TopicConnectionFactory topicFactory = (TopicConnectionFactory)iniCtx.lookup(m_connectionFactory);

                  Topic topic = (Topic)iniCtx.lookup(m_destinationName);

                  topicConnection = topicFactory.createTopicConnection();

                  topicSession = topicConnection.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);

       

                  logger.info("Subscribing to topic: " + topic.getTopicName());

       

                  if(durable){

                      subscriber = topicSession.createDurableSubscriber(topic, "testsub", null, false);

                  }

                  else{

                      subscriber = topicSession.createSubscriber(topic);

                  }

                  subscriber.setMessageListener(this);

                  topicConnection.start();

                  logger.info("JMSSubscriber initialized.");

       

      Here's my client log showing that clients are connecting and ready to receive:

       

      Jun 9, 2011 3:15:09 PM JMSSubscriber init

      INFO: Subscribing to topic: MyTopic

      INFO: JMSSubscriber initialized.

       

       

      Not sure what else to try.  Only one of my subscribers will receive the published message.  All the rest never receive anything.  Help would be greatly appreciated. Thanks.