Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.1.0, 5.2.0
    • Fix Version/s: 5.3.0
    • Component/s: Broker
    • Labels:
      None
    • Environment:

      JBOSS 4.2.2, AMQ 5.2.0 RA, JDK 1.5, Windows

      Description

      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

      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

      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

      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

      1. MessageGroupDelayedTest.java
        5 kB
        Hari Iyer
      2. MessageGroupTest.java
        5 kB
        Hari Iyer

        Activity

          People

          • Assignee:
            Dejan Bosanac
            Reporter:
            Hari Iyer
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development