You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Tim Chen (JIRA)" <ji...@apache.org> on 2007/02/06 20:12:02 UTC

[jira] Created: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

ActiveMQ connectionFactory ignores redeliveryPolicy
---------------------------------------------------

                 Key: AMQ-1152
                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 4.1.0
            Reporter: Tim Chen
         Attachments: jms.tar.bz2

Run mvn -Dtest=JmsTest test in the attached sample application.
Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated AMQ-1152:
---------------------------------

    Comment: was deleted

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "James Strachan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39135 ] 

James Strachan commented on AMQ-1152:
-------------------------------------

Incidentally I've created a test case (method testUseURIToConfigureRedeliveryPolicy()) in [ActiveMQConnectionFactoryTest|http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java] which configures the redelivery policy via URI and shows its passed through into the consumer. Am unsure how to reproduce this issue

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies resolved AMQ-1152.
-----------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 5.4.0)
                   5.3.0

This looks fixed to me in 5.3 ?

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "james strachan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38810 ] 

james strachan commented on AMQ-1152:
-------------------------------------

I wonder; could you test that the XML configuration really is configuring the connection factories RedeliveryPolicy? i.e. is ths some kinda bug in the XML configuration stuff or is there really an issue with the redelivery.

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39140 ] 

Guillaume Nodet commented on AMQ-1152:
--------------------------------------

The problem with spring jms support for consuming messages is that it each time a message is consumed, a new jms consumer is created.  And the redelivery policy is handled on the consumer side, not on the broker side.  Hence, the broker redispatch the message immediately.

Here is a diff to fix a small bug on 4.1.1 found while debugging this issue, but as explained above, the problem lies elsewhere.

{code}
Index: src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
===================================================================
--- src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java      (revision 540956)
+++ src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java      (working copy)
@@ -598,7 +598,9 @@
             if ((session.isTransacted() || session.isDupsOkAcknowledge())) {
                 acknowledge();
             }
-            deliveredMessages.clear();
+            if (!session.isTransacted()) {
+                deliveredMessages.clear();
+            }
             unconsumedMessages.close();
             this.session.removeConsumer(this);
         }
{code}

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully updated AMQ-1152:
----------------------------

    Fix Version/s: 5.3.0
                       (was: 5.2.0)

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>             Fix For: 5.3.0
>
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Tim Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38793 ] 

Tim Chen commented on AMQ-1152:
-------------------------------

Can someone at least respond to this?
This seems like a very key feature of ActiveMQ that is missing.

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies reassigned AMQ-1152:
-------------------------------

    Assignee: Rob Davies

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>            Assignee: Rob Davies
>             Fix For: 5.4.0
>
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Per Hammer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39990 ] 

Per Hammer commented on AMQ-1152:
---------------------------------

I had a similar problem (Spring+ActiveMQ, redelivery kept going if an exception was thrown in my listener). Setting <property name="cacheLevelName" value="CACHE_CONSUMER" />  on my DefaultMessageListenerContainer fixed the problem, and my consumer now only receives the message once - with no redelivery if the consumer throws an exception.

This is a workable solution for my circumstance, but I won't pretend to know enough about the JMS spec to say if it's the Correct Behaviour or not.

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>             Fix For: 5.2.0
>
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Yvonne Daher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40540 ] 

Yvonne Daher commented on AMQ-1152:
-----------------------------------

I have the same problem:
I set a redeliverypolicy with a max redelivery of 1 (I want to disable redeliveries) but I keep on receiving the messages... For information : in my message listener, message.getJMSRedelivered() returns true.

I cannot set the cacheLevel to CACHE_CONSUMER in my application and I find it really weird to have the redelivery count per consumer.

Did anyone find a solution to that ?

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>             Fix For: 5.2.0
>
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Tim Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38826 ] 

Tim Chen commented on AMQ-1152:
-------------------------------

If you mean if this is due to using xbean then no it isn't.
I have the same configuration using standard spring configurations on a live project that doesn't use xbean configuration and it is the same.

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "James Strachan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39315 ] 

James Strachan commented on AMQ-1152:
-------------------------------------

does setting the caching level in the spring message listener stuff help?

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1152) ActiveMQ connectionFactory ignores redeliveryPolicy

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39141 ] 

Guillaume Nodet commented on AMQ-1152:
--------------------------------------

Following is a diff of a small bug found while debugging this issue:

Index: src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
===================================================================
--- src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java      (revision 540956)
+++ src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java      (working copy)
@@ -598,7 +598,9 @@
             if ((session.isTransacted() || session.isDupsOkAcknowledge())) {
                 acknowledge();
             }
-            deliveredMessages.clear();
+            if (!session.isTransacted()) {
+                deliveredMessages.clear();
+            }
             unconsumedMessages.close();
             this.session.removeConsumer(this);
         }


Unfortunately, the problem is that spring creates a consumer each time it wait for a jms message and the redelivery policy is handled on a per consumer basis.  So when the consumer is closed, the transient data about redelivery is lost.   And when the consumer is closed, the broker re-dispatch the message immediately.

> ActiveMQ connectionFactory ignores redeliveryPolicy
> ---------------------------------------------------
>
>                 Key: AMQ-1152
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1152
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Tim Chen
>         Attachments: jms.tar.bz2
>
>
> Run mvn -Dtest=JmsTest test in the attached sample application.
> Redelivery is ignored and failed messages will not stop redelivering.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.