<!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">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;">
    JMSXDeliveryCount is not increased after client shutdown?!
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/andreas_back">andreas_back</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/543041#543041">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When testing this JBoss Messaging the following behaviour is observed:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ol><li>A message ist sent to the queue.</li><li>The message is processed in the onMessage method of a MessageListener in a client.</li><li>Within the onMessage method the JMSXDeliveryCount parameter is logged by msg.getIntProperty("JMSXDeliveryCount"); This first time the value is 1.</li><li>For testing purposes the client is shutdown (for example by Control-C under Linux or by shutting down the java process in the Netbeans IDE) while the onMessage method is processed.</li><li>After waiting more the 5 minutes the client is started again.</li><li>The original&#160; message is processed by the client again and msg.getIntProperty("JMSXDeliveryCount") returns the value 1 again.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>The question is: </strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Are the parameters (perhaps in the messaging-service.xml) to influence JBoss Messaging to increase the JMSXDeliveryCount if the message is redelivered in this case of abnormal client termination?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Or is it bug in my thinking of what JBoss Messaging should do or in JBoss Messaging itself?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>The context of this question is the following</strong>:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>We are still not able to solve the problem that has been described in&#160; </span><a class="jive-link-external-small" href="https://community.jboss.org/thread/151812" target="_blank">https://community.jboss.org/thread/151812</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>One idea was to set DefaultMaxDeliveryAttempts to 1 to let JBoss Messaging move messages into the dead queue if the messages are redelivered.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This does work if the client does call</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; (Session s).recover();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>as it is done in the JMSXDeliveryCountTest class. If (Session s).recover() is called then the JMSXDeliveryCount is increased. This can be observed when the message is processed the next time and also in the JBM_MSG_REF.delivery_count attribute in the database.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It is essential for us to prevent the redelivery of a message that kills a service-unit (a client) as a result of a system error in the message processing within the client. Such a message could iteratively shutdown a whole array of service-units..</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks in advance,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Andreas</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/543041#543041">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>