0

I have 2 queues setup in ActiveMQ broker. Wanted to test that producer flow control is working and producers for both queue are getting stalled when there is no memory. As soon as event occurs, messages start getting enqueued in both queues, but everything stops after memory reaches 100%(sometimes it is more than 100 % also, don't know how is that possible for persistent messages). Memory never reduces from 100 % so that producers can again start putting messages in both queues.

<policyEntry queue=">" memoryLimit="1000MB" producerFlowControl="true"/>
    <systemUsage>
                <systemUsage>
                    <memoryUsage>
                        <memoryUsage percentOfJvmHeap="70" />
                    </memoryUsage>
                    <storeUsage>
                        <storeUsage limit="50MB"/>
                    </storeUsage>
                    <tempUsage>
                        <tempUsage limit="50MB"/>
                    </tempUsage>
                </systemUsage>
            </systemUsage>

Here is the screenshot of memory

Is there something wrong with configuration? I want to slow down producer when memory is full(basically stop to enqueue) and again start when memory is free. Why is memory not getting free? Is there a way to slow down producer queuing even before memory is full if there are enough items on queue already to deque?

Saurabh Bhatia
  • 679
  • 2
  • 7
  • 11
  • Do you have consumers? If not then memory usage will never decrease. If so, then they need to be *faster* than the producers in order to reduce memory usage otherwise the producers will send new messages as soon as any messages are consumed effectively keeping you at 100% usage. – Justin Bertram Apr 24 '20 at 02:42
  • I have 5 consumers and 5 producers. Consumers are slow, that is fine. But I see that producers are not sending any message once all enqued messages are consumed. Memory remains at 100 % or even more.Its more like a deadlock state where Queue 2 has consumed all messages, and is idle. Queue 2 has stopped dequeing messages also as sson as memory reached 100 %. Why memory not decreasing now? – Saurabh Bhatia Apr 24 '20 at 03:48
  • How do you know all enqueued messages have been consumed? Have you taken thread dumps from all your consumers to ensure they aren't actually busy doing something? – Justin Bertram Apr 24 '20 at 13:52
  • I can see from ActiveMQ console that number of messages queued are same as dequed – Saurabh Bhatia Apr 27 '20 at 01:42
  • Are the messages being properly acknowledged? Do you have a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) you could share? – Justin Bertram Apr 27 '20 at 02:23

0 Answers0