Maybe some combination of constantPendingLimitStrategy and perfetch doesn't
work well. Maybe you can try
configuring prefetchRatePendingMessageLimitStrategy as explained here

http://activemq.apache.org/slow-consumer-handling.html

It'd be good to have a test case for this, to investigate further.

Regards
--
Dejan Bosanac
----------------------
Red Hat, Inc.
FuseSource is now part of Red Hat
dbosa...@redhat.com
Twitter: @dejanb
Blog: http://sensatic.net
ActiveMQ in Action: http://www.manning.com/snyder/


On Thu, Apr 10, 2014 at 8:53 AM, vlaxmi <vlaxmi.pa...@gmail.com> wrote:

> Hi,
>
> Below is the config in broker (activemq.xml)
>
> <policyEntry topic="test.>" topicPrefetch="100"
> advisoryForDiscardingMessages="true" advisoryForSlowConsumers="true" >
>                     <pendingMessageLimitStrategy>
>                         <constantPendingMessageLimitStrategy limit="43"/>
>                     </pendingMessageLimitStrategy>
>                 </policyEntry>
>
> The publisher is publishing large number of messages continuously. However,
> the consumer is consuming only first few messages successfully. After that
> the messages published by producer are not consumed by the consumer.
>
> The consumer config is as below -
>
>  <bean id="testConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL" value="${mq.brokerUrl}"/>
>                 <property name="alwaysSessionAsync" value="true"/>
>                 <property name="copyMessageOnSend" value="false"/>
>                 <property name="optimizeAcknowledge" value="true"/>
>                 <property name="useAsyncSend" value="true"/>
>                 <property name="watchTopicAdvisories" value="false" />
>         </bean>
>
>         <bean id="testPooledConnectionFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory"
>            destroy-method="stop">
>            <constructor-arg ref="testConnectionFactory" />
>            <property name="idleTimeout" value="0" />
>         </bean>
>
>           <bean id="testListenerAdapter"
> class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
>                         <property name="delegate"
> ref="testMessageHandler"/>
>             </bean>
>
>
> Why would the consumer receive only first few messages and rest all are
> discarded ? If the topicPrefetch is not configured in the broker, then all
> works good. However, I want to add prefetch limit to limit the number of
> messages buffered on slow consumer.
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Messages-not-received-after-setting-the-topicPrefetch-tp4680194.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to