activeMQ主题泛滥 [英] activeMQ topic flooding

查看:250
本文介绍了activeMQ主题泛滥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行ActiveMQ 5.4.0.我有一组用户,它们通过通用的ActiveMQ JMS提供程序在各种主题上相互订阅和发布.一段时间的活动后,ActiveMQ控制台开始显示

Running ActiveMQ 5.4.0. I have a group of users that subscribe and publish to each other on various topics through a common ActiveMQ JMS provider. After a while of activity, the ActiveMQ console starts displaying

INFO|USAGE MANAGER memory limit reached. Stopping producer (ID ...... to prevent flooding topic .....

对于各种主题,此消息反复出现.我知道在某些情况下,某些消息永远不会传递. 网络"上的任何生产者都没有实施任何形式的流量控制.他们只是发送而忘记.显然,一些生产者被封锁了,但是大多数最终还是挣脱了.我认为这些主题是非持久性/非持久性的.

This message occurs repeatedly for various topics. I know that in some cases, some messages are never delivered. None of the producers on the 'net' are implementing any kind of flow control. They just send and forget. Obviously, some of the producers are being blocked, but most eventually break free. I believe the topics are non-durable/non-persistent.

我只是使用默认的activemq配置.那么,如何最好地解决这个问题呢?禁用流量控制是明智的做法吗?

I'm just using the default activemq configuration. So, how best to fix this problem? Is it wise to disable flow control and how?

推荐答案

如果您使用默认的ActiveMQ配置,则将启用流控制.这就是为什么您收到这些消息的原因.

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">

此操作将使用ActiveMQ所需要的内存.但是请注意,如果ActiveMQ认为可能会导致其他队列出现问题,则有时会开始在磁盘上假脱机处理消息,这会影响性能,因为它碰到了磁盘. 这与持久性完全分开.但是,如果与总数据需求相比,在启动时为Java设置了合理的堆限制,那应该没问题.

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>

那将不使用磁盘,并且当memoryLimit被命中时会阻止生产者.同样,您应该能够对其进行定制,以使其适合您的配置.

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.

有关流控制的更多信息: http://activemq.apache.org/producer -flow-control.html

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

这篇关于activeMQ主题泛滥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆