Performance concern with prefetch=1 in long running transactions

Solution Verified - Updated -

Issue

Unit tested consuming a message within a long running transaction and prefetch=1 with the following steps:

1) set single message delay for 15 seconds (upon receiving first message, consumer client will put thread to sleep for this period of time)
2) write 30 messages to queue and allow to complete
3) read 30 messages from queue using 3 separate threads and allow to complete
4) repeat steps 2 and 3 two more times

Although setting prefetch=1 yields more favorable overall message throughput than prefetch=0, results show that a message within a long running transaction also delays processing of one additional message. Notice in the following excerpts showing the consumer read results for the 3 unit tests how the message delayed by 15 seconds also blocks one additional message:

Test 1
pool-1-thread-3 messagesReceived[14] threadTotalSeconds[1.842] messages/second[7.6]
pool-1-thread-1 messagesReceived[14] threadTotalSeconds[1.863] messages/second[7.515]
pool-1-thread-2 messagesReceived[2] threadTotalSeconds[15.98] messages/second[0.125]
Test 2
pool-1-thread-1 messagesReceived[13] threadTotalSeconds[1.986] messages/second[6.546]
pool-1-thread-2 messagesReceived[15] threadTotalSeconds[2.049] messages/second[7.321]
pool-1-thread-3 messagesReceived[2] threadTotalSeconds[16.059] messages/second[0.125]
Test 3
pool-1-thread-2 messagesReceived[14] threadTotalSeconds[1.845] messages/second[7.588]
pool-1-thread-1 messagesReceived[14] threadTotalSeconds[1.893] messages/second[7.396]
pool-1-thread-3 messagesReceived[2] threadTotalSeconds[15.996] messages/second[0.125]

Is this standard behavior for a thread to receive a message and block one additional message?

Environment

  • JBoss Fuse 6.0, 6.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.