简体   繁体   English

ActiveMQ InactivityMonitor 参数未应用于 HTTP 传输连接

[英]ActiveMQ InactivityMonitor params not applied on HTTP Transport connection

In my team we are using ActiveMQ 5.15.11 in production and our messages consumers are connected through HTTP protocol.在我的团队中,我们在生产中使用 ActiveMQ 5.15.11,我们的消息使用者通过 HTTP 协议连接。 Since we have network issues on the consumer side, we tried to disable the InactivityMonitor in the activemq.xml (see below)由于我们在消费者端有网络问题,我们尝试禁用 activemq.xml 中的InactivityMonitor (见下文)

    <transportConnectors>
        <transportConnector name="openwire" uri="tcp://host:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="http" uri="http://host:61617?wireFormat.maxInactivityDuration=0"/>
    </transportConnectors>

It seems like the " wireFormat.maxInactivityDuration=0 "is not applied since we have logs from InactivityMonitor in the consumer :似乎没有应用“ wireFormat.maxInactivityDuration=0 ”,因为我们在消费者中有来自 InactivityMonitor 的日志:

2020-03-18 00:00:03,426 [DEBUG] -  -  - WriteChecker: 10000ms elapsed since last write check.
2020-03-18 00:00:03,426 [DEBUG] -  -  - Running WriteCheck[https://host:443/activemq]
2020-03-18 00:00:03,509 [DEBUG] -  -  - WriteChecker: 10000ms elapsed since last write check.
2020-03-18 00:00:03,509 [DEBUG] -  -  - Running WriteCheck[https://host:443/activemq]
2020-03-18 00:00:03,514 [DEBUG] -  -  - WriteChecker: 10000ms elapsed since last write check.
2020-03-18 00:00:03,514 [DEBUG] -  -  - Running WriteCheck[https://host:443/activemq]
2020-03-18 00:00:03,642 [DEBUG] -  -  - WriteChecker: 10000ms elapsed since last write check.
2020-03-18 00:00:03,642 [DEBUG] -  -  - Running WriteCheck[https://host:443/activemq]
2020-03-18 00:00:03,706 [DEBUG] -  -  - WriteChecker: 10000ms elapsed since last write check.
2020-03-18 00:00:03,706 [DEBUG] -  -  - Running WriteCheck[https://host:443/activemq]
2020-03-18 00:00:03,738 [DEBUG] -  -  - WriteChecker: 10000ms elapsed since last write check.
2020-03-18 00:00:03,738 [DEBUG] -  -  - Running WriteCheck[https://host:443/activemq]

Furthermore, as soon as we get long network delay, we also get log :此外,一旦网络延迟很长,我们也会得到日志:

2020-03-01 20:43:17,578 [WARN ] -  -  - Transport (https://host:443/activemq) failed , attempting to automatically reconnect: {}
org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (>30000) long: https://host:443/activemq
    at org.apache.activemq.transport.AbstractInactivityMonitor$5.run(AbstractInactivityMonitor.java:246)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Notice 1 : ActiveMQ clients are JMS Consumers .注意 1:ActiveMQ 客户端是JMS 消费者

Notice 2 : we tried to disable InactivityMonitor on TCP transport and it works well with this protocol.注意 2:我们尝试在 TCP 传输上禁用InactivityMonitor ,它与此协议配合良好。

Thanks for your help in advance.提前感谢您的帮助。

For the HTTP transport I don't think that the standard OpenWire protocol negotiation step is performed which likely means that the server side configuration of max-inactivity-duration is visible at the client side.对于 HTTP 传输,我认为没有执行标准的 OpenWire 协议协商步骤,这可能意味着服务器端配置 max-inactivity-duration 在客户端可见。 This results in the client using the defaults for the inactivity checks which I recall as being 30 seconds or so which it then splits into smaller chunks for read and write checks.这导致客户端使用默认值进行不活动检查,我记得是 30 秒左右,然后将其拆分为更小的块以进行读写检查。

You would likely need to configure the client end to not do the checking using the same wireformat options.您可能需要将客户端配置为不使用相同的线格式选项进行检查。 I don't think any of that is extensively tested though so there could likely be issues with altering defaults over the HTTP transport wrappers.我认为其中任何一个都没有经过广泛的测试,因此通过 HTTP 传输包装器更改默认值可能会出现问题。 If it continues to misbehave then likely you'd need to open a JIRA with the ActiveMQ project to get something implemented to let you control it better.如果它继续行为不端,那么您可能需要使用 ActiveMQ 项目打开一个 JIRA 来实现一些东西,让您更好地控制它。

On the client side you should be able to disable the inactivity monitor with transport.useInactivityMonitor=false or maybe just useInactivityMonitor=false on the URI.在客户端,您应该能够在 URI 上使用transport.useInactivityMonitor=false或仅useInactivityMonitor=false禁用不活动监视器。

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

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