History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1859
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Anthony Enache
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

Race condition when browsing a queue with active Producers / Consumers

Created: 17/Jul/08 12:11 PM   Updated: 17/Jul/08 12:11 PM
Component/s: Broker
Affects Version/s: 5.1.0
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File QueueBrowserTest.java 2008-07-17 12:11 PM Anthony Enache 8 kb
Environment: Windows XP Professional, SP2


 Description  « Hide
Browsing a queue aggressively ( ie repeatedly with high frequency ) that is also experiencing message production and consumption results in some messages failing to be delivered to pre-registered consumers. Messages are visible on the queue to new consumers, but not pre-existing ones.

I've attached a junit test case that show this behaviour. Note that since this is a race condition, it manifests sporadically. You may need to run the test a few times before it fails.

The interesting bit is the method testProducerBrowserConsumer(). This sets up a couple of message producers, a message consumer, and a message browser on the same queue. The producers send a known number of messages on the queue while the browsers creates a number of queue browsers and iterates through the contents. The consumer pulls messages from the queue using a receive method set to time out after 30 sec. Once the consumer exits, we start a cleanup consumer to process any remaining messages on the queue. There should be zero messages outstanding. This is often not the case. I've modified the test case, originally, we just asserted that we had received the sent number of messages. I added the cleanup receiver to demonstrate that new consumers on the queue can see messages that pre-existing ones do not.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.