You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by shital <sh...@optonline.net> on 2006/07/27 19:47:52 UTC

slow consumer.. not working

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.


Re: slow consumer.. not working

Posted by shital <sh...@optonline.net>.
i only have slow consumers. i need to provide real time streaming prices to
client.. and client will not be able to keep up with the rate.

thanks fo reply.. i got that thing working, instead of making
ActiveMQPrefetchPolicy. i did following..

create topic with refetchsize and its working.

ActiveMQTopic topic = new
ActiveMQTopic("TEST.FOO?consumer.dispatchAsync=true&consumer.prefetchSize=2");

please any one needs any help. i have working example,

ActiveMQ is greate product


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


Re: slow consumer.. not working

Posted by James Strachan <ja...@gmail.com>.
Are you publishing quickly? Do you have fast consumers as well?

On 7/27/06, shital <sh...@optonline.net> wrote:
>
> 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.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/