<!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="https://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;">
    Using JMS Topic with Jboss Messaging 1.4.2.GA-SP1 seems unreliable.
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/vjbhakta">Vijay Bhakta</a> in <i>JBoss Messaging</i> - <a href="https://community.jboss.org/message/745434#745434">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p>Does anyone have experienced this and has a suggestion?<br/>I am using JBoss 4.2.3.GA with JBoss-Messaging 1.4.2.GA-SP1</p><p><br/>In my real application, I have now and then observed a JMS Message not received at one or the other client.<br/>To reproduce and analyze the same, I have made simple program closer to my scenario and focus on JMS.<br/>Let me brief you the scenario:<br/>1. A stateless Bean deployed with a method that generates 100 JMS messages to JMS Topic. Its more frequent when message size is ~1k.<br/>2. An external client 'API-Caller' that invokes the bean and calls the method, once every second for duration of 1-min. I launch typically more than 40 such clients.<br/>3. I stamped each Message with EventNumber, an incremental number to uniquely identify it.<br/>4. A Client 'Event-Listener' which subscribes to the JMS Topic and waits/receives messages. I launch 4 instances of this client on two different systems with 2 on each. Each 'Event-Listener' notes that the EventNumber if JMS Message skips a number.</p><p>I am running JBoss on Windows7 64-bit and Debian-Linux(Squeeze)<br/>And Clients 'API-Caller' and 'Event-Listener' on WindowsXP machine.</p><p>Running this test, I see that some JMS Messages are not received by one or the other client. Also, a Message received by one client is not recieved by other running on same system.</p><p><br/>A code outline of my stateless Bean :--------------------------------------&gt;</p><p>public class MyBean<br/>&#160;&#160;&#160; implements IMyBean<br/>{</p><p>&#160;&#160;&#160; private static synchronized int getEventNumber ()<br/>&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return ++mEventNumber;<br/>&#160;&#160;&#160; }</p><p><br/>&#160;&#160;&#160; public int produce100Messages (int PayloadInBytes)<br/>&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Connection connection = null;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Session session = null;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; MessageProducer publisher = null;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Integer num = 0;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; String payload = "";<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; for(int i=0; i&lt;PayloadInBytes; i++)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; payload += "Z";&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; try<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InitialContext ic = new InitialContext();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ConnectionFactory cf = (ConnectionFactory) ic.lookup("java:/JmsXA");<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Topic topic = (Topic) ic.lookup("topic/MyTopic");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; connection = cf.createConnection();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; session = connection.createSession(true, Session.SESSION_TRANSACTED);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; publisher = session.createProducer(topic);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; connection.start();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; num = getEventNumber();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; num = num * 100;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (int i = 0; i &lt; 100; i++)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Message msg = session.createTextMessage(num.toString() + ";" + payload);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; publisher.send(msg);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; num++;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; num--;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; catch (Exception anException)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; anException.printStackTrace();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; finally<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ...<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Close producer, session, and connection<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return num;<br/>&#160;&#160;&#160; }<br/>}</p><p><br/>The code outline at subscriber end :-------------------------------------------&gt;<br/>public class MYMsgListener<br/>&#160;&#160;&#160; implements MessageListener<br/>{<br/>&#160;&#160; ...</p><p>&#160;&#160; public void onMessage (Message anArg0)<br/>&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160; ...<br/>&#160;&#160;&#160;&#160; ...</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String[] arrStr = ((TextMessage) anArg0).getText().split(";");&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Integer eventNumber = Integer.parseInt(arrStr[0]);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mEventQ.add(eventNumber);<br/>&#160;&#160;&#160;&#160; ...<br/>&#160;&#160;&#160; }<br/>&#160;&#160;&#160; ...</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/745434#745434">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="https://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>