activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: How to handle fast producer when JMS timeout happens?
Date Fri, 21 May 2010 16:26:20 GMT
I think u have it. for more info on the prefetch see:
 http://activemq.apache.org/what-is-the-prefetch-limit-for.html

note that the Pending Message Limit Strategy are only for topics. With a
queue, there is no discarding of messages, just expiry if that is specified
on each message.


On 21 May 2010 16:32, easyl <easy.lin@gmail.com> wrote:

>
> thanks for the link!
> Some points I still cannot understand.
>
> What the PrefetchPolicy really means in the content with queue size?
> For example I use MDB as Consumer
> Producer - send -> (Queue) ---> MessageDrivenBean
>
> does the pre-fetch limit determine how many maximal messages can be sent to
> the queue when the consumer is getting exhausted? (It seems not, by default
> it is 1000 for non-persistent queues. But I can have 7000+ message stalled
> in the queue)
>
> What I want is to let messages not sent to Queue (to avoid timeout in
> queue)
> if the consumer is slow down.
> (The pending message can not be lost or discarded.)
> The server is allowed to be slow, but not hangs.
>
> I should not use Pending Message Limit Strategy
> (http://activemq.apache.org/slow-consumer-handling.html), since it will
> discard messages. right?
>
>
> From my understanding from the link I have 2 strategies....
> 1. disable "producer flow control",  (
> http://activemq.apache.org/producer-flow-control.html
> A common requirement is to disable flow control so that message dispatching
> continues until all available disk is used up by pending messages (whether
> persistent or non persistent messaging is configured).)
> 2. less "pre-fetch" from consumer by setting for example
> tcp://localhost:61616?jms.prefetchPolicy.all=1
>
> is there anything I miss?
>
>
>
>
> Gary Tully wrote:
> >
> > have u read through:
> > http://activemq.apache.org/slow-consumer-handling.html
> >
> > On 21 May 2010 14:25, easyl <easy.lin@gmail.com> wrote:
> >
> >>
> >> Geronimo 2.2 / AMQ 5.3
> >>
> >> I have the following scenario
> >>
> >> producerA  --send-->(Queue)-->  consumerB
> >>
> >> The prodcerA sends JMS message continuously to consumerB, while
> consumerB
> >> can consume message slower than that producerA produces. (consumerB
> >> processes the message and has database operations.)
> >>
> >> To test the system I let prodcerA sending message without pause.
> >>
> >> At the beginning it seems no problem at all. No message stalled in the
> >> Queue.
> >>
> >> But after some hours the whole server run slower and slower, till a huge
> >> amount of messages (e.g. 7000+) stalled in the Queue, while producerA
> >> still
> >> sends message to the Queue. And the consumerB seems
> >>  not work any more!
> >>
> >> Once I stop the producerA, the messages would then slowly consumed by
> >> consumerB.
> >>
> >> In such situation I will get such exception from AMQ
> >> javax.jms.JMSException: No ManagedConnections available within
> configured
> >> blocking timeout ( 15000 [ms] ) for pool
> >>
> >>
> org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor@6bc31ee0
> >>        at
> >>
> >>
> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:101)
> >>        at
> >>
> >>
> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:67)
> >>        at
> >>
> >>
> org.apache.activemq.ra.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:120)
> >>
> >>
> >> my activemq.xml
> >>
> >> <broker xmlns="http://activemq.apache.org/schema/core"
> >>            brokerName="${activemq.brokerName}"
> >>            tmpDataDirectory="${activemq.data}/tmp_storage"
> >>            useShutdownHook="false"
> >>            start="false"
> >>            advisorySupport="false"
> >>            persistent="false">
> >>
> >>  <destinationPolicy>
> >>          <policyMap>
> >>            <policyEntries>
> >>              <policyEntry queue=">"  memoryLimit="128mb">
> >>                <deadLetterStrategy>
> >>                  <individualDeadLetterStrategy queuePrefix="DLQ."
> >> useQueueForQueueMessages="true" />
> >>                </deadLetterStrategy>
> >>              </policyEntry>
> >>              <policyEntry topic=">" memoryLimit="128mb">
> >>                <deadLetterStrategy>
> >>                  <individualDeadLetterStrategy topicPrefix="DLT."
> >> useQueueForTopicMessages="true" />
> >>                </deadLetterStrategy>
> >>              </policyEntry>
> >>            </policyEntries>
> >>          </policyMap>
> >>        </destinationPolicy>
> >> ....
> >>
> >> Connection URL is
> >>
> >>
> >>
> tcp://localhost:61616?keepAlive=true&amp;jms.copyMessageOnSend=false&amp;jms.watchTopicAdvisories=false&amp;socket.tcpNoDelay=true&amp;wireFormat.tcpNoDelayEnabled=true
> >>
> >>
> >> should I disable producerFlowControl?
> >> is keepAlive a problem?
> >>
> >> How to keep the system robust when having fast producer and slow
> >> consumer?
> >>
> >> thanks :P
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/How-to-handle-fast-producer-when-JMS-timeout-happens--tp28633802p28633802.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > http://blog.garytully.com
> >
> > Open Source Integration
> > http://fusesource.com
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/How-to-handle-fast-producer-when-JMS-timeout-happens--tp28633802p28635401.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message