activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vlaxmi <vlaxmi.pa...@gmail.com>
Subject Messages not received after setting the topicPrefetch
Date Thu, 10 Apr 2014 06:53:22 GMT
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.

Mime
View raw message