1 Reply Latest reply on Sep 16, 2010 1:03 PM by pchandler

    Mixing Slow and Fast Consumers on a topic.

    pchandler

      My scenario in ActiveMQ 5.3:

       

         I have a fast producer/publisher to topic A.

         I have both Fast and Slow Consumers/Subscribers on topic A .

       

      The behavior I am seeing is that the Producer slows down to match the speed of the slowest Consumer.

       

      The desired  behavior (what I need help configuring) is: the Producer does not slow down and the slower Consumer(s) just drop older messages. Question: How do I configure this behavior in ActiveMQ?

       

      Below is what I have tried so far with no luck:

      On the Broker: persistent="false"

      Sender: jms.useAsyncSend="true"

      destinationPolicy:

                          <policyEntry topic=">" producerFlowControl="false" memoryLimit="64mb">
                              
                              <deadLetterStrategy>
                                  <individualDeadLetterStrategy  topicPrefix="deadLetter"></individualDeadLetterStrategy>
                              </deadLetterStrategy>
                              
                              <!-- How to dispatch the messages -->
                              <dispatchPolicy>
                                  <strictOrderDispatchPolicy></strictOrderDispatchPolicy>
                              </dispatchPolicy>
                              
                              <!-- which messages to get rid of -->
                              <messageEvictionStrategy>
                                  <oldestMessageEvictionStrategy></oldestMessageEvictionStrategy>
                              </messageEvictionStrategy>
      
                              <!-- Keep around 2.5 times the prefetch count for each consumer -->
                              <pendingMessageLimitStrategy>
                                  <prefetchRatePendingMessageLimitStrategy multiplier="2.5"></prefetchRatePendingMessageLimitStrategy>
                              </pendingMessageLimitStrategy>
      
                              <pendingSubscriberPolicy>
                                  <fileCursor></fileCursor>
                              </pendingSubscriberPolicy>
                              
                              <!--  Keep the last 1000 messages -->
                              <subscriptionRecoveryPolicy>
                                  <fixedCountSubscriptionRecoveryPolicy maximumSize="1000"></fixedCountSubscriptionRecoveryPolicy> 
                              </subscriptionRecoveryPolicy>
      
      
                          </policyEntry>
      

       

        • 1. Re: Mixing Slow and Fast Consumers on a topic.
          pchandler

          OK. if I set "time to live" then I get the desired behavior "the Producer does not slow down and the slower Consumer(s) just drop older messages."

           

          example:

                      producer.setTimeToLive(1000L);
          

           

           

          Is there a way to configure the destination/topic in activemq-broker.xml to provide the same behavior for a topic?