I have activemq, which is used on my system, and I see the following message: TopicSubscription: consumer = ...: The pending message cursor [o rg.apache.activemq.broker.region.cursors.VMPendingMessageCursor @ 1684f89c] is full, it uses a temporary usage (0%) or memory usage (100%), adding a lock () in anticipation of the release of resources.
This is because if I understand that my consumer is slow, while my producer is fast. The result of this is that eventually my producer is locked until the consumer reads the message and frees up memory. I want to say that my producer is not locked, and also when the memory is full of old messages.
Given my understanding of what I read, the following configuration should do the trick (messageEvictionStrategy, pendingMessageLimitStrategy), but it does not work for me, and I cannot understand why.
I pointed out that there is a low level of memory usage restrictions (35 MB) to make the problem faster for testing, but the fact is that I need it in the end, when the problem arises because activemq just discards old messages .
I found one unsatisfactory installation solution in ActiveMQConnectionFactory useAsyncSend = true and specifying sendTimeout. This forces the manufacturer to block, but in this way the last message is deleted, not the older one.
Finally, I speak for short-lived topics.
Any help guys would be perfect. Below I have an activemq configuration
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" producerFlowControl="false" memoryLimit="35 Mb">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
<messageEvictionStrategy>
<oldestMessageEvictionStrategy/>
</messageEvictionStrategy>
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="10"/>
</pendingMessageLimitStrategy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<systemUsage>
<systemUsage sendFailIfNoSpace="true">
<memoryUsage>
<memoryUsage limit="35 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="5000 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
activemq version 5.7.0
I am using spring template to send messages:
<bean class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="pooledJmsConnectionFactory"/>
<property name="timeToLive" value="100"/>
</bean>
I pass javax.jms.ObjectMessage, a relatively small size.
I found the problem in client packages. I have many toppics in my application, but I managed to play it locally sending from 1 thread, non-stop messages constantly and always to the same topic. Sending a message was just a small line.
, , , 1 ( ) (), . , .
, ,
<transportConnectors>
<transportConnector name="openwire" uri="nio://0.0.0.0:33029?wireFormat.maxInactivityDuration=60000&wireFormat.maxInactivityDurationInitalDelay=60000"/>
</transportConnectors>