[ 
https://issues.apache.org/jira/browse/AMQ-3027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15060246#comment-15060246
 ] 

Tamas Cserveny commented on AMQ-3027:
-------------------------------------

I can confirm that the issue exists on the latest version. The problem is very 
likely that the following code in Queue.java:

{code:java}
protected boolean assignMessageGroup(Subscription subscription, 
QueueMessageReference node) throws Exception {
~~~
                    if 
(groupOwner.equals(subscription.getConsumerInfo().getConsumerId())) {
                        // A group sequence < 1 is an end of group signal.
                        if (sequence < 0) {
                            messageGroupOwners.removeGroup(groupId);
                            
subscription.getConsumerInfo().decrementAssignedGroupCount();
                        }
                    } else {
                        result = false;
                    }
{code}

... closes the assignment instantly so the next message will go to another 
group even if this message did not yet dispatched/ACK-ed. 
Closing should be done by the ACK on the message, not in case of assignment.


> Message Groups and Group Sequence -1 sending messages in group to multiple 
> consumers
> ------------------------------------------------------------------------------------
>
>                 Key: AMQ-3027
>                 URL: https://issues.apache.org/jira/browse/AMQ-3027
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.1
>         Environment: Windows Server 2008 for broker, Windows 7 for clients, 
> NMS
>            Reporter: Mark Gellings
>             Fix For: NEEDS_REVIEW
>
>
> I am using message groups with ActiveMQ 5.4.1 and when ending the group I'm 
> seeing some odd behavior.  
> I run two consumers on Queue A.  There is a 200ms delay when processing a 
> message.  I have a producer send 500 messages with group A to the broker with 
> the last having a group sequence of -1.  The first consumer starts processing 
> messages from group A while the producer is creating the messages, but as 
> soon as the broker gets the message with group sequence of -1 that message 
> gets sent to the second consumer, and then the remaining in the group go to 
> the second consumer.  So the processing is out of order and all the messages 
> don't go to the same consumer.  
> I believe only messages created after the one with group sequence of -1 
> should go to the second consumer.  And the message with -1 sequence gets 
> processed last.   Should this also be the case if the master broker fails 
> over during this time?
> Issue AMQ-2952 does not appear to be the same issue.  Unfortunately I do not 
> have time to test this against the current snapshot or include a test case.  
> The scenario, however, is very simple and I'm sure it would be easy to whip 
> up an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to