You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Santosh Banerjee (Created) (JIRA)" <ji...@apache.org> on 2012/01/07 07:23:39 UTC

[jira] [Created] (AMQ-3657) Messages getting dispatched in a single thread even with multiple consumer sessions if prefetchPolicy.queuePrefetch is more than 1

Messages getting dispatched in a single thread even with multiple consumer sessions if prefetchPolicy.queuePrefetch is more than 1
----------------------------------------------------------------------------------------------------------------------------------

                 Key: AMQ-3657
                 URL: https://issues.apache.org/jira/browse/AMQ-3657
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
    Affects Versions: 5.5.1
         Environment: Windows XP/\
\,

























































            Reporter: Santosh Banerjee


If the prefetch limit is more than 1, ActiveMQ would tend to dispatch the messages to a single consumer session, even though there are multiple active consumer sessions (each with a different MessageConsumer/Listener on the same queue) available.

So messages are getting processed sequentially in a SINGLE thread,if the prefetch limit is > 1

But if we set the prefetch to 1 explicitly, e.g. by the following code, concurrent processing happens as expected.

((ActiveMQConnectionFactory)connectionFactory).getPrefetchPolicy().setQueuePrefetch(1);


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (AMQ-3657) Messages getting dispatched in a single thread even with multiple consumer sessions if prefetchPolicy.queuePrefetch is more than 1

Posted by "Timothy Bish (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish closed AMQ-3657.
-----------------------------

    Resolution: Not A Problem

This is working as designed.  The prefetch option is your way of controlling whether a consumer gets more than one message dispatched to it when it subscribes, for each consumer you need to determine if you are going to load balance on a destination or be a single consumer.  In the case you are seeing as the consumers subscribe the Queue will distribute across the consumers once they all subscribed but the initial consumer is going to get sent more than one message if your prefect is set greater than one.
                
> Messages getting dispatched in a single thread even with multiple consumer sessions if prefetchPolicy.queuePrefetch is more than 1
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3657
>                 URL: https://issues.apache.org/jira/browse/AMQ-3657
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.1
>         Environment: Windows XP/\
> \,
>            Reporter: Santosh Banerjee
>
> If the prefetch limit is more than 1, ActiveMQ would tend to dispatch the messages to a single consumer session, even though there are multiple active consumer sessions (each with a different MessageConsumer/Listener on the same queue) available.
> So messages are getting processed sequentially in a SINGLE thread,if the prefetch limit is > 1
> But if we set the prefetch to 1 explicitly, e.g. by the following code, concurrent processing happens as expected.
> ((ActiveMQConnectionFactory)connectionFactory).getPrefetchPolicy().setQueuePrefetch(1);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3657) Messages getting dispatched in a single thread even with multiple consumer sessions if prefetchPolicy.queuePrefetch is more than 1

Posted by "Santosh Banerjee (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193755#comment-13193755 ] 

Santosh Banerjee commented on AMQ-3657:
---------------------------------------

My bad,

I should have looked at this too
http://activemq.apache.org/i-do-not-receive-messages-in-my-second-consumer.html
                
> Messages getting dispatched in a single thread even with multiple consumer sessions if prefetchPolicy.queuePrefetch is more than 1
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3657
>                 URL: https://issues.apache.org/jira/browse/AMQ-3657
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.1
>         Environment: Windows XP/\
> \,
>            Reporter: Santosh Banerjee
>
> If the prefetch limit is more than 1, ActiveMQ would tend to dispatch the messages to a single consumer session, even though there are multiple active consumer sessions (each with a different MessageConsumer/Listener on the same queue) available.
> So messages are getting processed sequentially in a SINGLE thread,if the prefetch limit is > 1
> But if we set the prefetch to 1 explicitly, e.g. by the following code, concurrent processing happens as expected.
> ((ActiveMQConnectionFactory)connectionFactory).getPrefetchPolicy().setQueuePrefetch(1);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira