activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-2016) Message grouping not honored when consumers started with existing messages
Date Mon, 19 Jan 2009 14:19:00 GMT

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

Gary Tully commented on AMQ-2016:
---------------------------------

prefetch=1 should help here. Part of the problem is that the dispatch logic can only deal
with the consumers that it has and on the first dispatch iteration it finds only one consumer
and figures that that consumer has to deal with all of the groups. With prefetch of one, after
the first dispatch iteration there may be another consumer (at least it allow the internal
dispatch lock to be released so that another consumer can be added between dispatch attempts)

Currently there is an issue that evaluates message group selection before determining if a
consumer is full, but if this is resolved, prefetch=1 should make group selection evenly distributed
among subscriptions that arrive at the same time and before the group assignment has been
determined. 

> Message grouping not honored when consumers started with existing messages
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2016
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2016
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.1.0, 5.2.0
>         Environment: JBOSS 4.2.2, AMQ 5.2.0 RA, JDK 1.5, Windows
>            Reporter: Hari Iyer
>            Priority: Blocker
>         Attachments: MessageGroupDelayedTest.java, MessageGroupNewConsumerTest.java,
MessageGroupTest.java
>
>
> Messages are processed FIFO when messages with different groups are sent to a queue and
then the consumers are started. 
> If the messages are sent after the consumers are started, then message grouping works
as expected.
> Two JUnit tests are attached. 
> 1. MessageGroupTest.java starts up 3 consumers and then sends 30 messages evenly distributed
across 3 groups A, B, and C. 
> Each consumer then gets assigned a group and the ordering is as expected based on the
different sleep intervals defined as seen in the log below
> {quote}
> 2008-11-26 15:06:09,841 INFO  [main] [com.test.MessageGroupTest] 30 messages sent to
group A/B/C
> 2008-11-26 15:06:09,841 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 9
> 2008-11-26 15:06:09,841 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 9
> 2008-11-26 15:06:09,841 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 9
> 2008-11-26 15:06:09,934 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 8
> 2008-11-26 15:06:10,044 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 7
> 2008-11-26 15:06:10,137 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 6
> 2008-11-26 15:06:10,247 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 5
> 2008-11-26 15:06:10,340 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 4
> 2008-11-26 15:06:10,450 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 3
> 2008-11-26 15:06:10,544 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 2
> 2008-11-26 15:06:10,653 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 1
> 2008-11-26 15:06:10,747 INFO  [Thread-4] [com.test.MessageGroupTest] worker3 received
msg C remaining 0
> 2008-11-26 15:06:10,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 8
> 2008-11-26 15:06:11,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 7
> 2008-11-26 15:06:12,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 6
> 2008-11-26 15:06:13,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 5
> 2008-11-26 15:06:14,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 8
> 2008-11-26 15:06:14,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 4
> 2008-11-26 15:06:15,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 3
> 2008-11-26 15:06:16,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 2
> 2008-11-26 15:06:17,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 1
> 2008-11-26 15:06:18,840 INFO  [Thread-2] [com.test.MessageGroupTest] worker1 received
msg B remaining 0
> 2008-11-26 15:06:19,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 7
> 2008-11-26 15:06:24,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 6
> 2008-11-26 15:06:29,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 5
> 2008-11-26 15:06:34,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 4
> 2008-11-26 15:06:39,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 3
> 2008-11-26 15:06:44,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 2
> 2008-11-26 15:06:49,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 1
> 2008-11-26 15:06:54,840 INFO  [Thread-3] [com.test.MessageGroupTest] worker2 received
msg A remaining 0
> {quote}
> 2. MessageGroupDelayedTest.java sends 30 messages evenly distributed across 3 groups
A, B, and C and then starts up 3 consumers.
> All 30 messages are delivered in FIFO order to a single consumer as seen in the log below
> {quote}
> 2008-11-26 15:25:50,021 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 9
> 2008-11-26 15:25:55,021 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 9
> 2008-11-26 15:25:56,021 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 9
> 2008-11-26 15:25:56,130 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 8
> 2008-11-26 15:26:01,130 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 8
> 2008-11-26 15:26:02,130 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 8
> 2008-11-26 15:26:02,224 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 7
> 2008-11-26 15:26:07,224 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 7
> 2008-11-26 15:26:08,224 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 7
> 2008-11-26 15:26:08,333 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 6
> 2008-11-26 15:26:13,333 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 6
> 2008-11-26 15:26:14,333 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 6
> 2008-11-26 15:26:14,427 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 5
> 2008-11-26 15:26:19,427 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 5
> 2008-11-26 15:26:20,427 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 5
> 2008-11-26 15:26:20,536 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 4
> 2008-11-26 15:26:25,536 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 4
> 2008-11-26 15:26:26,536 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 4
> 2008-11-26 15:26:26,630 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 3
> 2008-11-26 15:26:31,630 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 3
> 2008-11-26 15:26:32,630 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 3
> 2008-11-26 15:26:32,739 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 2
> 2008-11-26 15:26:37,739 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 2
> 2008-11-26 15:26:38,739 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 2
> 2008-11-26 15:26:38,833 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 1
> 2008-11-26 15:26:43,832 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 1
> 2008-11-26 15:26:44,832 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 1
> 2008-11-26 15:26:44,926 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg A remaining 0
> 2008-11-26 15:26:49,926 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg B remaining 0
> 2008-11-26 15:26:50,926 INFO  [Thread-4] [com.test.MessageGroupDelayedTest] worker3 received
msg C remaining 0
> {quote}

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


Mime
View raw message