2

I'm using ActiveMQ 5.7.0 and want the fileQueueCursor to spill into the temp store if the queue destination reaches a certain memory threshold. I don't want to enable persistence.

I've configured a destinationPolicy:

    <destinationPolicy>
        <policyMap>
            <policyEntries>
                <policyEntry queue=">">  
                    <pendingQueuePolicy>
                        <fileQueueCursor />
                    </pendingQueuePolicy>
                </policyEntry>
            </policyEntries>
        </policyMap>
    </destinationPolicy>

I've also configured systemUsage with a low memoryUsage for testing:

    <systemUsage>
        <systemUsage>
            <memoryUsage>
                <memoryUsage limit="5 mb" />
            </memoryUsage>
            <tempUsage>
                <tempUsage limit="32 mb" />
            </tempUsage>
        </systemUsage>
    </systemUsage>

I have some code running in my debugger which will insert messages into the queue. While running I can see messages about increased memory usage:

2013-May-09 17:40:12.963 PDT DEBUG [ActiveMQ Transport: tcp:///127.0.0.1:63223@61616] [org.apache.activemq.usage.Usage:fireEvent] [Usage.java:245] [] [] [] - default:memory:queue://testReq:memory: usage change from: 69% of available memory, to: 70% of available memory

I've noticed that AMQ's FilePendingMessageCursor.flushToDisk() is called at around 70% memory usage but because the 'store' member is null the code is not executed.

When I enable persistence the store is not null and flushToDisk() completes.

Is it possible to set a temporary store without enabling persistence?

rnoska
  • 21
  • 1
  • 1
    To allow message caching but prevent messages from being persisted I set the delivery mode on the message producer to non persistent via: messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT) – rnoska May 14 '13 at 00:15

0 Answers0