rouan
rouan

Reputation: 7289

How to simulate a "Full Queue" on ActiveMQ?

We recently had some issues in our testing environment when ActiveMQ ran out of system resources.

How can I simulate this scenario locally in order to reproduce the issue and test potential fixes?

Upvotes: 1

Views: 639

Answers (1)

rouan
rouan

Reputation: 7289

I managed to simulate the scenario by changing the ActiveMQ config.

You can set the system resources available in ActiveMQ's configuration file, which you can find at libexec/conf/activemq.xml in your ActiveMQ installation directory.

For example, you can change the default values:

  <systemUsage>
    <systemUsage>
        <memoryUsage>
            <memoryUsage percentOfJvmHeap="70" />
        </memoryUsage>
        <storeUsage>
            <storeUsage limit="100 gb"/>
        </storeUsage>
        <tempUsage>
            <tempUsage limit="50 gb"/>
        </tempUsage>
    </systemUsage>
  </systemUsage>

To tiny values instead:

  <systemUsage>
    <systemUsage>
        <memoryUsage>
            <memoryUsage percentOfJvmHeap="1" />
        </memoryUsage>
        <storeUsage>
            <storeUsage limit="512 kb"/>
        </storeUsage>
        <tempUsage>
            <tempUsage limit="512 kb"/>
        </tempUsage>
    </systemUsage>
  </systemUsage>

Run or restart ActiveMQ and it should fill up very quickly.

More info in the ActiveMQ docs: http://activemq.apache.org/producer-flow-control.html

Upvotes: 3

Related Questions