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 (Closed) (JIRA)" <ji...@apache.org> on 2012/01/07 20:21:39 UTC

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

     [ 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