ActiveMQ和maxPageSize [英] ActiveMQ and maxPageSize

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

问题描述

我想将maxPageSize设置为默认值200更大的数字。

I would like to set the maxPageSize to a larger number from its default 200.

这是我在activemq.xml文件中设置的方式:

This is how I set in the activemq.xml file:

<destinationPolicy>
            <policyMap>
              <policyEntries>
              ---
                <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb" maxPageSize="SOME_LARGE_NUMBER">
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy>

此更改可帮助我使用返回的QueueBrowser.getEnumeration()获取队列中的消息数即使队列中的消息数大于200,也为200。

This change helps me get the number of messages in a queue using QueueBrowser.getEnumeration() as it returned 200 even if the number of messages in the queue were greater than 200.

请参阅: http://docs.oracle.com/javaee/1.4/api/javax/jms/QueueBrowser.html for QueueBrowser.getEnumeration( )。

Please see: http://docs.oracle.com/javaee/1.4/api/javax/jms/QueueBrowser.html for QueueBrowser.getEnumeration().

将maxPageSize从200更改为1000有什么副作用?
反正会影响经纪人的表现吗?

What is the side effect of changing the maxPageSize from 200 to say 1000? Does it affect the broker's performance anyway?

除了 要从中传出的最大持久性消息数之外,我没有看到此属性的任何文档 (在此页面上一次存储)。

I am not seeing any documentation for this property other than "maximum number of persistent messages to page from store at a time" on this page:

http://activemq.apache.org/per-destination-policies.html

感谢您的时间!

推荐答案

最大页面大小只是表明将要加载到内存中的消息数,因此影响是..它将消耗更多的内存记忆。

Max page size simply indicates the number of messages that will be loaded into memory, so the impact is.. that it will consume more memory.

在两行之间阅读时,这样做的原因是反模式。作为应用程序一部分的队列浏览实际上是对消息传递的滥用-消息队列在被视为队列时效果最好。先进先出。而不是您扫描以查看消息是否到达的数组。

Reading between the lines though, the reason that you are doing this is an anti-pattern. Queue browsing as part of an application is really a misuse of messaging - a message queue works best when treated as a queue. First in, first out. Not as an array that you scan to see whether a message has arrived.

您最好使用每条消息,并且可以:

You are much better off consuming each of the messages, and either:


  1. 根据它们的有效负载将它们分类到其他队列中,然后对第二级队列进行不同的处理,或者

  2. 将有效负载存储到数据库中并根据内容进行选择。

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

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