You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by vlaxmi <vl...@gmail.com> on 2014/04/10 08:53:22 UTC
Messages not received after setting the topicPrefetch
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.
Re: Messages not received after setting the topicPrefetch
Posted by vlaxmi <vl...@gmail.com>.
Thanks for the reply.
I will check prefetchRatePendingMessageLimitStrategy and prefetch
combination.
However, when I have below config in activemq.xml(broker config)
{code}
<policyEntry topic="test.>" advisoryForDiscardingMessages="true"
advisoryForSlowConsumers="true" >
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="43"/>
</pendingMessageLimitStrategy>
</policyEntry>
{code}
i.e. broker config without topicPrefech and added the
jms.prefetchPolicy.topicPrefetch=100 to the consumer config in broker url,
then the messages were received by consumer.
So once the topicPrefech is set in broker, then messages are not delivered
to clients.. but the same works when configured explicitly in each client.
What would be the reason?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Messages-not-received-after-setting-the-topicPrefetch-tp4680194p4680302.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Messages not received after setting the topicPrefetch
Posted by Dejan Bosanac <de...@nighttale.net>.
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
dbosanac@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 <vl...@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.
>