activeMQ topic flooding

南笙酒味 提交于 2019-12-05 22:27:09

If you're using the default ActiveMQ configuration, flow control is on. This is why you're getting those messages.

If you don't want to use flow control you could do something like this:

<policyEntry topic="myTopic" producerFlowControl="false">

What this will do is use as much memory as ActiveMQ has to give you. Be aware, however, that at some point ActiveMQ will start spooling messages through the disk if it thinks you could cause problems for other queues, etc - this will effect performance because it's hitting the disks. This is completely separate from persistence. However if you have set a reasonable heap limit for java on startup in comparison to your total data needs, you should be ok.

Note that if you want to tell it not to spool through the disk, you do have to use flow control and have to set a max in memory size such as:

<policyEntry topic="myTopic" producerFlowControl="true" memoryLimit="200mb">
    <pendingQueuePolicy>
    <vmQueueCursor/>
</pendingQueuePolicy>
</policyEntry>

That would not use the disk, and block producers when the memoryLimit is hit. Again, you should be able to tailor this so it works for your configuration.

For more info on flow control: http://activemq.apache.org/producer-flow-control.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!