简体   繁体   English

ActiveMQ 消息不断被清除

[英]ActiveMQ messages keeps getting purged

How to avoid getting purge messages in activemq?如何避免在activemq中收到清除消息?

I have front end application (App A) that makes request to back end app (App B) for data via ActiveMQ (version 5.15.8).我有前端应用程序(应用程序 A),它通过 ActiveMQ(版本 5.15.8)向后端应用程序(应用程序 B)请求数据。

When I make a request that retrieves a small amount of data, things work fine as App A gets that data, from App B, and displays it.当我发出一个检索少量数据的请求时,一切正常,因为 App A 从 App B 获取数据并显示它。

However, when App A makes a request to App B (via amq) that retrieves a lot of data, I keep getting this purged message (shown below) in the ActiveMQ active.log and then App A never receives the data.但是,当应用程序 A 向应用程序 B(通过 amq)发出请求以检索大量数据时,我不断在 ActiveMQ active.log 中收到这条已清除的消息(如下所示),然后应用程序 A 永远不会收到数据。

I should note that App B gets the request from App A, then gets the requested data and forwards it back to ActiveMQ (to then be forwarded to App A).我应该注意到 App B 从 App A 获取请求,然后获取请求的数据并将其转发回 ActiveMQ(然后转发到 App A)。 But after sending the data to ActiveMQ this purge message occurs:但是在将数据发送到 ActiveMQ 后,会出现此清除消息:

2020-03-12 16:29:03,738 | 2020-03-12 16:29:03,738 | INFO |信息 | temp-queue://ID:mcam443-PC-61788-1748020379598-6:1:1 on dispose, purge of 1 pending messages : org.apache.activemq.broker.region.cursors.VMPendingMessageCursor@5d237edf | temp-queue://ID:mcam443-PC-61788-1748020379598-6:1:1 处理,清除1 条待处理消息:org.apache.activemq.broker.region.cursors.VMPendingMessageCursor@5d237edf | org.apache.activemq.broker.region.TempQueue | org.apache.activemq.broker.region.TempQueue | ActiveMQ BrokerService[activemqPrimary] Task-89 ActiveMQ BrokerService[activemqPrimary] Task-89

Here's my destination policy section of the activemq.xml file这是我的 activemq.xml 文件的目标策略部分

    <destinationPolicy>
        <policyMap>
          <policyEntries>
            <policyEntry queue=">" expireMessagesPeriod="120000" producerFlowControl="true" memoryLimit="5mb">
              <pendingQueuePolicy>
                <vmQueueCursor/>
              </pendingQueuePolicy>
              <pendingMessageLimitStrategy>
                <constantPendingMessageLimitStrategy limit="-1"/>
              </pendingMessageLimitStrategy>

            </policyEntry>
            <policyEntry queue="D.>" expireMessagesPeriod="120000" producerFlowControl="true" memoryLimit="5mb">
              <pendingQueuePolicy>
                <vmQueueCursor/>
              </pendingQueuePolicy>
              <pendingMessageLimitStrategy>
                  <constantPendingMessageLimitStrategy limit="-1"/>
              </pendingMessageLimitStrategy>
            </policyEntry>
          </policyEntries>
        </policyMap>
    </destinationPolicy>

I set the expireMessagesPeriod to be 4 minutes, and I see that App B responds usually within 2 minutes.我将expireMessagesPeriod设置为 4 分钟,我看到 App B 通常在 2 分钟内响应。 So that didn't seem to help.所以这似乎没有帮助。

I also set constantPendingMessageLimitStrategy to be -1 which is supposed to disable the discarding of messages ( http://activemq.apache.org/slow-consumer-handling.html )我还将constantPendingMessageLimitStrategy设置为 -1,这应该禁用消息的丢弃( http://activemq.apache.org/slow-consumer-handling.html

Again, the purge message doesn't occur when App A makes a request that only returns small amount of data.同样,当应用程序 A 发出仅返回少量数据的请求时,不会出现清除消息。

How can I avoid getting purge data on large requests?如何避免在大型请求中获得清除数据? or at all?或者根本没有?

Not much information here to go on but from the limited log data it appears the purge message is indicating that you've closed a connection without consuming all messages from a temporary destination and so when the Connection is closed the Temporary Destinations it created are disposed and that one happened to have 1 unconsumed message.这里没有太多信息要继续,但从有限的日志数据看来,清除消息表明您已关闭连接而没有消耗来自临时目的地的所有消息,因此当连接关闭时,它创建的临时目的地被处理并那个碰巧有 1 条未消费的消息。 The only way to avoid getting that message would be to ensure you've consumed all the messages from the Temp Queue.避免收到该消息的唯一方法是确保您已经使用了来自临时队列的所有消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM