You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Kevin (JIRA)" <ji...@apache.org> on 2008/06/12 09:56:00 UTC

[jira] Created: (AMQ-1792) Consumer stops work when another consumer commits

Consumer stops work when another consumer commits
-------------------------------------------------

                 Key: AMQ-1792
                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.1.0
         Environment: Win XP, Java 1.5
            Reporter: Kevin
            Priority: Blocker
         Attachments: Situation.zip

Hi *,

5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.

2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.

When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:

Consumer-1 work begins!
Consumer-2 work begins!
Consumer-3 cant work!
Consumer-3 cant work!
[..]
Consumer-3 cant work!
Consumer-3 cant work!
Consumer-1 work ends!
Consumer-1 work begins!
Consumer-2 work ends!
Consumer-2 work begins!
Consumer-1 work ends!
Consumer-1 work begins!
Consumer-2 work ends!
Consumer-1 work ends!

"Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.

I also attached the configuration file of the broker, maybe I made something wrong there.

I hope this issue will not go unheeded like my other issue posted a week ago.

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


RE: [jira] Resolved: (AMQ-1792) Consumer stops work when another consumer commits

Posted by Sh...@sungard.com.
Hi,

Any one knows why I get this error

"ERROR TransportConnector -Could not accept connections:connection reset"

I am using activemq version 5.2

Shital


P Think before you print
-----Original Message-----
From: Rob Davies (JIRA) [mailto:jira@apache.org] 
Sent: Friday, July 31, 2009 2:53 PM
To: dev@activemq.apache.org
Subject: [jira] Resolved: (AMQ-1792) Consumer stops work when another consumer commits


     [ https://issues.apache.org/activemq/browse/AMQ-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies resolved AMQ-1792.
-----------------------------

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

This looks resolved 

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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



[jira] Assigned: (AMQ-1792) Consumer stops work when another consumer commits

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

Rob Davies reassigned AMQ-1792:
-------------------------------

    Assignee: Rob Davies

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>            Priority: Blocker
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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


[jira] Resolved: (AMQ-1792) Consumer stops work when another consumer commits

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

Rob Davies resolved AMQ-1792.
-----------------------------

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

This looks resolved 

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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


[jira] Commented: (AMQ-1792) Consumer stops work when another consumer commits

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46147#action_46147 ] 

Gary Tully commented on AMQ-1792:
---------------------------------

I worked through the test case. What happens is that each of the consumers gets a shot at consuming all of the existing messages (5) in the queue. The recovery dispatch in Queue.addSubscription is responsible for that.
For the two consumers that do work, 1 message gets dispatched that fills the subscription (because of the prefetch value) and the onMessage blocks. Because of the transacted session, an on delivery ack results in the prefetch being exceeded by one and a second message is dispatched. This results in 4 of the 5 messages locked/dispatched.
For the third, it consumes and generates an new message. the third consumer is thus not full and consumes what it produced. This continues for 5 seconds until one of the other two consumers becomes available and consumes what the third produces. This ends the third consumers run as all available messages have been dispatched.

To see a change in behavior, increase the Config.sMESSAGESTOSEND to 10. In this way, two iterations of consumer 1 and 2 will be needed to consume ~6 messages, leaving 4 for consumer three so it will continue past the first consumer commit. These remaining messages will get dispatched between the available 3 consumers and consumer 3 will be able to continue.

I think things are working as expected here. Don't think it is critical.

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>            Priority: Blocker
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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


[jira] Updated: (AMQ-1792) Consumer stops work when another consumer commits

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

Gary Tully updated AMQ-1792:
----------------------------

    Priority: Major  (was: Blocker)

reducing severity, things are working as expected I think for this particular scenario.

One other thing to play with: ack Mode Session.DUPS_OK_ACKNOWLEDGE;
This will negate the production of the DeliveryAck and only one message, the prefetch value, will be dispatched/locked by a sleeping consumer.

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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


[jira] Commented: (AMQ-1792) Consumer stops work when another consumer commits

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45709#action_45709 ] 

Rob Davies commented on AMQ-1792:
---------------------------------

This looks like a prefetch issue - can you set the prefetch size = 1 ?
see http://activemq.apache.org/what-is-the-prefetch-limit-for.html

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>            Priority: Blocker
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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


[jira] Commented: (AMQ-1792) Consumer stops work when another consumer commits

Posted by "Kevin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45721#action_45721 ] 

Kevin commented on AMQ-1792:
----------------------------

Rob,

its indeed some time ago, but the prefetch size was set to 1 (like you can see in the zip-archive in Connector.java).

Do you have another idea?

> Consumer stops work when another consumer commits
> -------------------------------------------------
>
>                 Key: AMQ-1792
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1792
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0
>         Environment: Win XP, Java 1.5
>            Reporter: Kevin
>            Assignee: Rob Davies
>            Priority: Blocker
>             Fix For: 5.3.0
>
>         Attachments: Situation.zip
>
>
> Hi *,
> 5 messages are put into a queue. 3 consumer are created, all with their own transacted-sessions. They all implements MessageListener.
> 2 consumers recieve a message, wait 5 seconds and commit their messages. The other consumer sends the recieved message back to the queue (no rollback!!!) and commit. When one of the first consumer commits, the third consumer stops working and doesn't recieve any messages.
> When you starts the attached Main-class (sets first the ip-address of your broker in the config-class) you'll see some output:
> Consumer-1 work begins!
> Consumer-2 work begins!
> Consumer-3 cant work!
> Consumer-3 cant work!
> [..]
> Consumer-3 cant work!
> Consumer-3 cant work!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-2 work begins!
> Consumer-1 work ends!
> Consumer-1 work begins!
> Consumer-2 work ends!
> Consumer-1 work ends!
> "Consumer-3 cant work" means, that consumer-3 sends a message back to the broker. "Consumer1-work begins" is the first code-line in the onMessage-Method, "Consumer1-work ends" the last one.
> I also attached the configuration file of the broker, maybe I made something wrong there.
> I hope this issue will not go unheeded like my other issue posted a week ago.

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