...
Где Shaper-IP
- название атрибута шаблона операторского профиля (IP-адрес шейпера), 127.0.0.1
- его значение, 192.168.1.1
- IP-адрес ActiveMQ.
Ускорение работы ActiveMQ
Задача
В базе сделана переотправка профилей, но ActiveMQ слишком медленно забирает сообщения из базы. Нужно ускорить работу ActiveMQ
Решение
Мы настраиваем курсор, это делается в конфиге activemq.xml
Code Block | ||||
---|---|---|---|---|
| ||||
...
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="false" advisorySupport="false">
<!--
Use VM cursor
For more information, see:
http://activemq.apache.org/message-cursors.html
-->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" producerFlowControl="true" memoryLimit="1000mb">
<pendingSubscriberPolicy>
<vmCursor />
</pendingSubscriberPolicy>
</policyEntry>
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1000mb">
<pendingQueuePolicy>
<vmQueueCursor/>
</pendingQueuePolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
... |
Старые настройки можно убарть
Code Block | ||||
---|---|---|---|---|
| ||||
...
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" >
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
... |