[jboss-user] [JBoss Messaging] - Jboss 5.1.0.GA JMS topic acts like a queue

Dan Rush do-not-reply at jboss.com
Thu Jun 9 20:15:32 EDT 2011

Dan Rush [http://community.jboss.org/people/mrfixit440] created the discussion

"Jboss 5.1.0.GA JMS topic acts like a queue"

To view the discussion, visit: http://community.jboss.org/message/609528#609528

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"
      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
      <attribute name="JNDIName">jms/MyTopic</attribute>

Here's jboss log on startup:

15:10:30,217 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory at 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());

                subscriber = topicSession.createDurableSubscriber(topic, "testsub", null, false);
                subscriber = topicSession.createSubscriber(topic);
            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.

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110609/329f38bf/attachment-0001.html 

More information about the jboss-user mailing list