Simplest config is to use the default cursor, which is the store
cursor that has an embedded file cursor for non persistent messages.

To have the file cursor spool to disk, it needs to reach 70% of its
destination limit, so the system usage memory limits need to exceed
this value, which the appear to do in your config below: 20mb > 1mb

The spooling will continue till the temp usage limit is reached and
the resource exception is throws as a result of sendFailIfNoSpace.

I though there was a simple junit test case for this but it seems not,
I just added one to an existing test case, see:
http://svn.apache.org/viewvc?view=revision&revision=1233367

The new test is:
org.apache.activemq.bugs.TempStorageBlockedBrokerTest#testFillTempAndConsume

play around with that or compare to what you are doing and if you find
any problem use that test case as the basis for a bug report.

Note, the vm cursors do not spool to disk, so they will not use any
temp store (disk space)

On 19 January 2012 10:45, Joe Smith <joesmithc...@yahoo.com> wrote:
> Hi,
>
> I'm trying to impl a use case where a non-persistent msg producer can
> send msgs until no more disk space.   We want to flow the msgs to disk with a 
> limit - and to detect when the space is full (instead of being throttled).
>
> The attempt is to set tempUsage limit with sendFailIfNoSpace on the 
> systemUsage.  The target queue is myqueue.
>
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" producerFlowControl="true" 
> memoryLimit="1mb">
>                   <pendingSubscriberPolicy>
>                     <vmCursor />
>                   </pendingSubscriberPolicy>
>                 </policyEntry>
>                 <policyEntry queue=">" producerFlowControl="true" 
> memoryLimit="1mb">
>                 </policyEntry>
>                 <policyEntry queue="myqueue" producerFlowControl="true" 
> memoryLimit="1mb">
>                   <pendingQueuePolicy>
>                     <fileQueueCursor/>
>                   </pendingQueuePolicy>
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy>
>
>         <systemUsage>
>             <systemUsage sendFailIfNoSpace="true" >
>                 <memoryUsage>
>                     <memoryUsage limit="20 mb"/>
>                 </memoryUsage>
>                 <storeUsa
>                     <storeUsage limit="1 gb"/>
>                 </storeUsage>
>                 <tempUsage>
>                     <tempUsage limit="33 mb"/>
>                 </tempUsage>
>             </systemUsage>
>         </systemUsage>
>
>
> But the outcome was not exact.
>
> 1 - fileQueueCursor, flow control on, producer jms.useAsyncSend=false
>
> The producer stopped after sending about 2600 msgs.  When a consumer was 
> connected, no msgs were received, even though the queue has about 700 msgs.
>
>
> 2 - fileQueueCursor, flow control off, producer jms.useAsyncSend=false
>
> Same as above - the flow control did not affect the outcome.
> 3 - vmQueueCursor, flow control on
>
> Producer received onException call
> back after 1mb memory was exhausted.  No msg
> flowed to disk.  Producer can continue to send w/o error after a consumer had 
> drained msgs from memory.
>
> 4 - vmQueueCursor, flow control off
> Producer continued to send - beyond 32mb tempUsage limit.
>
> Broker version 5.5.1
> Java 1.6
> 64-bit linux system
>
>
> Any suggestions on how to utilize all disk space but with notification when 
> space is near depletion?
>
>
> Thanks



-- 
http://fusesource.com
http://blog.garytully.com

Reply via email to