activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shital <shitalbpa...@optonline.net>
Subject slow consumer.. not working
Date Thu, 27 Jul 2006 17:47:52 GMT

I have requirement where i need to throw away some messages because consumer
is not able to keep up.

i am using activeMQ 4.1. i modified the destinationPolicy as follows ..
(this is just test so i have limit 1)

<destinationPolicy>
      <policyMap><policyEntries>
        
          <policyEntry topic=">">
            <messageEvictionStrategy>
              <oldestMessageEvictionStrategy />
            </messageEvictionStrategy>
            <pendingMessageLimitStrategy>
              <constantPendingMessageLimitStrategy limit="1"/>
            </pendingMessageLimitStrategy>
          </policyEntry>
      </policyEntries></policyMap>
    </destinationPolicy>

and in the consumer i am setting prefetch size as follows.. again for test i
have limit 1

ActiveMQPrefetchPolicy policy = new ActiveMQPrefetchPolicy();
            policy.setMaximumPendingMessageLimit(1);
            policy.setTopicPrefetch(5);
            
            connectionFactory.setPrefetchPolicy(policy);

then i run the sample program (which i wrote).. i have some Thread.sleep(..)
in onMessage(..) so make consumer slow in my test program, but looks like
its not dropping any messages. slowly slowly but consumer gets all messages
??

what am i doing wrong here ??

Please Help...
-- 
View this message in context: http://www.nabble.com/slow-consumer..-not-working-tf2011021.html#a5525918
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message