You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2010/08/17 17:35:48 UTC

[jira] Commented: (AMQCPP-311) The worker threads in the threadpool seem to sleep when a receiver waits for messages from the broker.

    [ https://issues.apache.org/activemq/browse/AMQCPP-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61237#action_61237 ] 

Timothy Bish commented on AMQCPP-311:
-------------------------------------

Cam you create and a attach a short but complete test case that reproduces this issue?

> The worker threads in the threadpool seem to sleep when a receiver waits for messages from the broker. 
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AMQCPP-311
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-311
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl
>    Affects Versions: 3.2.2
>         Environment: Windows. ActiveMQ broker 5.3.1. 
>            Reporter: Helen Huang
>            Assignee: Timothy Bish
>            Priority: Blocker
>
> In our application, we are using a CmsTemplate (activemq::cmsutil::CmsTemplate)  to receive messages. For each received message, we first create a task then put it into the threadpool (decaf::util::concurrent::ThreadPool) for processing. We expect the worker threads are independent from the receiving functionality of the CmsTemplate. While a receiver is waiting for new messages, the worker threads should be able to process the messages that have been received already. However, that is not we observed. The worker threads seem to be put into sleep until the receiver timeouts. 
> The following is the log we have created. you will see that we received five messages. The last message was received and enqueued at 14:13:20 (by thread 0BB0), It was only processed at 14:13:30 (by thread 0FDC), at/after a receive timeout (on thread 0BB0) . The waiting time seems to be equal to the receive timeout which was 10 seconds. We have repeated the test by setting the receive timeout to 200ms,1s, 3s, 5s, and 10s. We observed the same behavior with each test. The configuration for the threadpool was: MaxThreads 20, BockSize 5, ReservedThreads 10. This is a critical issue for our application. Hope you will be able to look into it soon. Your help is highly appreciated!
> SAServer08/16 14:13:20     1,995,656 0BB0> Receiver::ReceiveMessage() - received a cms message.
> SAServer08/16 14:13:20     1,995,656 0BB0> Receiver::ReceiveMessage() - The payload of the cms message is: <?xml version="1.0" encoding="UTF-8"?><itemPolicy><upc>000671115010</upc><returnAllRecords>0</returnAllRecords></itemPolicy>.
> SAServer08/16 14:13:20     1,995,656 0FAC> Receiver::ExecuteMessagingTask() - calling the message listener function for a received message
> SAServer08/16 14:13:20     1,995,656 0BB0> Receiver::run() - enqueued a messaging task
> SAServer08/16 14:13:20     1,995,687 0BB0> Receiver::ReceiveMessage() - received a cms message.
> SAServer08/16 14:13:20     1,995,687 0BB0> Receiver::ReceiveMessage() - The payload of the cms message is: <?xml version="1.0" encoding="UTF-8"?><itemPolicy><upc>000671115010</upc><returnAllRecords>0</returnAllRecords></itemPolicy>.
> SAServer08/16 14:13:20     1,995,687 0BB0> Receiver::run() - enqueued a messaging task
> SAServer08/16 14:13:20     1,995,687 0730> Receiver::ExecuteMessagingTask() - calling the message listener function for a received message
> SAServer08/16 14:13:20     1,995,687 0BB0> Receiver::ReceiveMessage() - received a cms message.
> SAServer08/16 14:13:20     1,995,687 0BB0> Receiver::ReceiveMessage() - The payload of the cms message is: <?xml version="1.0" encoding="UTF-8"?><itemPolicy><upc>000671115010</upc><returnAllRecords>0</returnAllRecords></itemPolicy>
> SAServer08/16 14:13:20     1,995,687 0BB0> Receiver::run() - enqueued a messaging task
> SAServer08/16 14:13:20     1,995,687 0F98> Receiver::ExecuteMessagingTask() - calling the message listener function for a received message
> SAServer08/16 14:13:20     1,995,703 0BB0> Receiver::ReceiveMessage() - received a cms message.
> SAServer08/16 14:13:20     1,995,703 0BB0> Receiver::ReceiveMessage() - The payload of the cms message is: <?xml version="1.0" encoding="UTF-8"?><itemPolicy><upc>000671115010</upc><returnAllRecords>0</returnAllRecords></itemPolicy>
> SAServer08/16 14:13:20     1,995,703 0BB0> Receiver::run() - enqueued a messaging task
> SAServer08/16 14:13:20     1,995,703 0E08> Receiver::ExecuteMessagingTask() - calling the message listener function for a received message
> SAServer08/16 14:13:20     1,995,703 0BB0> Receiver::ReceiveMessage() - received a cms message.
> SAServer08/16 14:13:20     1,995,703 0BB0> Receiver::ReceiveMessage() - The payload of the cms message is: <?xml version="1.0" encoding="UTF-8"?><itemPolicy><upc>000671115010</upc><returnAllRecords>0</returnAllRecords></itemPolicy>
> SAServer08/16 14:13:20     1,995,703 0BB0> Receiver::run() - enqueued a messaging task
> SAServer08/16 14:13:21     1,995,906 0FAC> Enter CCmsMessageHandlerAPI::SendMessage(), clientName:SAServer, destName:Response
> SAServer08/16 14:13:21     1,995,906 0FAC> Sender::SendMessage() - sent message <itemPolicy>
> 	<upc>000671115010</upc>
> 	<returnAllRecords>0</returnAllRecords>
> 	<weightEntries>
> 		<weightEntry>
> 			<initialWeight>290</initialWeight>
> 			<averageWeight>260</averageWeight>
> 			<weightTally>3</weightTally>
> 			<lastDate>2145934800</lastDate>
> 			<isApproved>1</isApproved>
> 			<isPPWU>0</isPPWU>
> 			<standardDev>-1</standardDev>
> 			<weightTolerance>-999</weightTolerance>
> 		</weightEntry>
> 	</weightEntries>
> </itemPolicy> successfully to cms
> SAServer08/16 14:13:21     1,995,906 0FAC> Exit CCmsMessageHandlerAPI::SendMessage() - Success
> SAServer08/16 14:13:21     1,996,140 0730> Enter CCmsMessageHandlerAPI::SendMessage(), clientName:SAServer, destName:Response
> SAServer08/16 14:13:21     1,996,156 0730> Sender::SendMessage() - sent message <itemPolicy>
> 	<upc>000671115010</upc>
> 	<returnAllRecords>0</returnAllRecords>
> 	<weightEntries>
> 		<weightEntry>
> 			<initialWeight>290</initialWeight>
> 			<averageWeight>260</averageWeight>
> 			<weightTally>3</weightTally>
> 			<lastDate>2145934800</lastDate>
> 			<isApproved>1</isApproved>
> 			<isPPWU>0</isPPWU>
> 			<standardDev>-1</standardDev>
> 			<weightTolerance>-999</weightTolerance>
> 		</weightEntry>
> 	</weightEntries>
> </itemPolicy> successfully to cms
> SAServer08/16 14:13:21     1,996,156 0730> Exit CCmsMessageHandlerAPI::SendMessage() - Success
> SAServer08/16 14:13:21     1,996,375 0F98> Enter CCmsMessageHandlerAPI::SendMessage(), clientName:SAServer, destName:Response
> SAServer08/16 14:13:21     1,996,390 0F98> Sender::SendMessage() - sent message <itemPolicy>
> 	<upc>000671115010</upc>
> 	<returnAllRecords>0</returnAllRecords>
> 	<weightEntries>
> 		<weightEntry>
> 			<initialWeight>290</initialWeight>
> 			<averageWeight>260</averageWeight>
> 			<weightTally>3</weightTally>
> 			<lastDate>2145934800</lastDate>
> 			<isApproved>1</isApproved>
> 			<isPPWU>0</isPPWU>
> 			<standardDev>-1</standardDev>
> 			<weightTolerance>-999</weightTolerance>
> 		</weightEntry>
> 	</weightEntries>
> </itemPolicy> successfully to cms
> SAServer08/16 14:13:21     1,996,390 0F98> Exit CCmsMessageHandlerAPI::SendMessage() - Success
> SAServer08/16 14:13:21     1,996,609 0E08> Enter CCmsMessageHandlerAPI::SendMessage(), clientName:SAServer, destName:Response
> SAServer08/16 14:13:21     1,996,625 0E08> Sender::SendMessage() - sent message <itemPolicy>
> 	<upc>000671115010</upc>
> 	<returnAllRecords>0</returnAllRecords>
> 	<weightEntries>
> 		<weightEntry>
> 			<initialWeight>290</initialWeight>
> 			<averageWeight>260</averageWeight>
> 			<weightTally>3</weightTally>
> 			<lastDate>2145934800</lastDate>
> 			<isApproved>1</isApproved>
> 			<isPPWU>0</isPPWU>
> 			<standardDev>-1</standardDev>
> 			<weightTolerance>-999</weightTolerance>
> 		</weightEntry>
> 	</weightEntries>
> </itemPolicy> successfully to cms
> SAServer08/16 14:13:21     1,996,625 0E08> Exit CCmsMessageHandlerAPI::SendMessage() - Success
> SAServer08/16 14:13:30     2,005,703 0FDC> Receiver::ExecuteMessagingTask() - calling the message listener function for a received message
> SAServer08/16 14:13:30     2,005,703 0BB0> Receiver::ReceiveMessage() - receive timed out
> SAServer08/16 14:13:31     2,005,921 0FDC> Enter CCmsMessageHandlerAPI::SendMessage(), clientName:SAServer, destName:Response
> SAServer08/16 14:13:31     2,005,921 0FDC> Sender::SendMessage() - sent message <itemPolicy>
> 	<upc>000671115010</upc>
> 	<returnAllRecords>0</returnAllRecords>
> 	<weightEntries>
> 		<weightEntry>
> 			<initialWeight>290</initialWeight>
> 			<averageWeight>260</averageWeight>
> 			<weightTally>3</weightTally>
> 			<lastDate>2145934800</lastDate>
> 			<isApproved>1</isApproved>
> 			<isPPWU>0</isPPWU>
> 			<standardDev>-1</standardDev>
> 			<weightTolerance>-999</weightTolerance>
> 		</weightEntry>
> 	</weightEntries>
> </itemPolicy> successfully to cms
> SAServer08/16 14:13:31     2,005,921 0FDC> Exit CCmsMessageHandlerAPI::SendMessage() - Success
> SAServer08/16 14:13:40     2,015,703 0BB0> Receiver::ReceiveMessage() - receive timed out
> SAServer08/16 14:13:50     2,025,703 0BB0> Receiver::ReceiveMessage() - receive timed out
> SAServer08/16 14:14:00     2,035,703 0BB0> Receiver::ReceiveMessage() - receive timed out

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