<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Jboss 5.1.0.GA JMS topic acts like a queue
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/mrfixit440">Dan Rush</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/609528#609528">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>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.&#160; I have multiple subscribers and only one of my subscribers will receive the published message. So it acts like a queue.&#160; Here is my configuration:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;mbean code="org.jboss.jms.server.destination.TopicService"</p><p>&#160;&#160;&#160;&#160;&#160; name="jboss.messaging.destination:service=Topic,name=MyTopic"</p><p>&#160;&#160;&#160;&#160;&#160; xmbean-dd="xmdesc/Topic-xmbean.xml"&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;attribute name="JNDIName"&gt;jms/MyTopic&lt;/attribute&gt;</p><p>&#160;&#160; &lt;/mbean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here's jboss log on startup:</p><p></p><p>15:10:30,217 INFO&#160; [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1b4e5b0 started</p><p>15:10:30,217 INFO&#160; [TopicService] Topic[jms/MyTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InitialContext iniCtx = null;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(m_isStandAlone) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iniCtx = new InitialContext();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iniCtx = JMSUtil.getInitialContext(APPSERVER_INITIAL_CONTEXT_FACTORY, m_providerUrl, m_username, m_password, null);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TopicConnectionFactory topicFactory = (TopicConnectionFactory)iniCtx.lookup(m_connectionFactory);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Topic topic = (Topic)iniCtx.lookup(m_destinationName);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; topicConnection = topicFactory.createTopicConnection();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; topicSession = topicConnection.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("Subscribing to topic: " + topic.getTopicName());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(durable){</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subscriber = topicSession.createDurableSubscriber(topic, "testsub", null, false);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subscriber = topicSession.createSubscriber(topic);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subscriber.setMessageListener(this);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; topicConnection.start();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("JMSSubscriber initialized.");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here's my client log showing that clients are connecting and ready to receive:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Jun 9, 2011 3:15:09 PM JMSSubscriber init</p><p>INFO: Subscribing to topic: MyTopic</p><p>INFO: JMSSubscriber initialized.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Not sure what else to try.&#160; Only one of my subscribers will receive the published message.&#160; All the rest never receive anything.&#160; Help would be greatly appreciated. Thanks.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/609528#609528">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>