activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <>
Subject [jira] [Updated] (AMQ-2685) FlowControl does not work when no consumer is attached
Date Fri, 01 Apr 2011 11:22:11 GMT


Gary Tully updated AMQ-2685:

    Fix Version/s:     (was: 5.5.0)

> FlowControl does not work when no consumer is attached
> ------------------------------------------------------
>                 Key: AMQ-2685
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>         Environment: Linux SMP x86_64 GNU/Linux
> java version "1.6.0_17"
> Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
>            Reporter: André Lison
>             Fix For: 5.6.0
> When a producer fills a queue with flow control enabled and there is no consumer, flow
control does not work as expected, therefore it does not slow down or block the producer.
If the queue is over the configured limit and then a consumer is attached, the flow control
kicks in immediately and denies producers to push new messages onto the queue until the CursorPercentUsage
is down to 100%.
> More detailed:
> When there is only one producer and no consumer, the jconsole shows CursorMemoryUsage=0
and CursorPercentUsage=0 and the broker fills up the storage until it is full according to
the systemUsage settings. CursorMemoryUsage can increase slightly but does not reflect the
overall memory usage of the queue (mem+storage). The producer is only stopped (by the flow
control?) when the queue hits the storeUsage-limit.
> As soon as there is a consumer attached, the CursorMemoryUsage shows much higher values
and the CursorPercentUsage is of course way over 100%. The producer is blocked until the CursorPercentUsage
down to 100% and CursorPercentUsage is almost equal to the policyEntry/memoryLimit of the
queue - which looks like the desired behavior to me. Now flow control works and keeps producer
and consumer in balance.
> My activemq.xml:
>         ...
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" producerFlowControl="false" memoryLimit="5mb">
>                   <pendingSubscriberPolicy>
>                     <vmCursor />
>                   </pendingSubscriberPolicy>
>                 </policyEntry>
>                 <policyEntry queue="result.>" producerFlowControl="true" memoryLimit="60
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy> 
>         .....
>         <systemUsage>
>             <systemUsage>
>                 <memoryUsage>
>                     <memoryUsage limit="100 mb"/>
>                 </memoryUsage>
>                 <storeUsage>
>                     <storeUsage limit="1 gb" name="foo"/>
>                 </storeUsage>
>                 <tempUsage>
>                     <tempUsage limit="100 mb"/>
>                 </tempUsage>
>             </systemUsage>
>         </systemUsage>
>         ...

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message