gpt4 book ai didi

apache-camel - ActiveMQ 5.10.2 : [org. apache.activemq.broker.TransportConnection] TransportConnection (triggerStartAsyncNetworkBridgeCreation:Failed to add Connection

转载 作者:行者123 更新时间:2023-12-04 10:55:53 27 4
gpt4 key购买 nike

我们正在使用带有 ActiveMQ 的 Camel 2.9.8,并且最近将 ActiveMq 从 5.5.1 升级到 5.10.2(最后一个 JDK6 版本,因为我们在 JBoss EAP 6 上运行)。我们的设置是一个简单的“代理网络”(使用发现),具有通过 tcp://和 vm://连接器连接的多个节点。

一切正常,但经过几天的 100% 工作后,我突然在日志中收到“无法添加连接”警告。更准确地说:

2019-12-05 09:31:01,623 WARN  [org.apache.activemq.broker.TransportConnection] TransportConnection (triggerStartAsyncNetworkBridgeCreation: remoteBroker=tcp://nlheevpat01pha.x.global/10.32.50.163:61612@41557, localBroker= vm://nlheevpat02pha_prd_01#6262) Failed to add Connection nlheevpat02pha_prd_01->nlheevpat01pha_prd_01-55572-1575391926556-6265:1

我们从未在旧的 5.5.1 版本中收到警告。 activeMQ 队列仍然正常运行,所有预期的连接都出现在 activeMQ Web 管理控制台的“连接”选项卡下。

我们的配置如下
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />

<!-- shutdown hook is disabled as RAR classloader may be gone at shutdown -->
<amq:broker xmlns="http://activemq.apache.org/schema/core"
brokerName="${activemq.broker.name}"
useJmx="true"
useShutdownHook="false"
networkConnectorStartAsync="true"
dataDirectory="${activemq.data.dir}">

<amq:destinationPolicy>
<amq:policyMap>
<amq:policyEntries>
<amq:policyEntry queue=">" producerFlowControl="true" memoryLimit="500mb">
<amq:deadLetterStrategy>
<amq:individualDeadLetterStrategy queuePrefix="DLQ." />
</amq:deadLetterStrategy>
</amq:policyEntry>
<amq:policyEntry topic=">" producerFlowControl="true" memoryLimit="300mb">
<amq:deadLetterStrategy>
<amq:individualDeadLetterStrategy queuePrefix="DLQ." />
</amq:deadLetterStrategy>
</amq:policyEntry>


<amq:policyEntry queue="Service.Request" producerFlowControl="true" memoryLimit="3 gb">
<amq:dispatchPolicy>
<amq:roundRobinDispatchPolicy />
</amq:dispatchPolicy>
</amq:policyEntry>

</amq:policyEntries>

</amq:policyMap>
</amq:destinationPolicy>

<amq:managementContext>
<!-- use appserver provided context instead of creating one, for jboss use: -Djboss.platform.mbeanserver -->
<amq:managementContext createConnector="false" />
</amq:managementContext>

<amq:networkConnectors>
<amq:networkConnector
uri="multicast://${activemq.network.multicast.address}:${activemq.network.multicast.port}?group=${activemq.network.multicast.group}"
userName="${activemq.auth.system.username}"
password="${activemq.auth.system.password}"
conduitSubscriptions="false"
decreaseNetworkConsumerPriority="true"
/>
</amq:networkConnectors>

<amq:persistenceAdapter>
<amq:kahaDB
directory="${activemq.data.dir}/kahadb"
checkForCorruptJournalFiles="true"
checksumJournalFiles="true"
/>
</amq:persistenceAdapter>

<amq:plugins>
<amq:simpleAuthenticationPlugin>
<amq:users>
<amq:authenticationUser
username="${activemq.auth.system.username}"
password="${activemq.auth.system.password}"
groups="users"
/>
</amq:users>
</amq:simpleAuthenticationPlugin>

<amq:authorizationPlugin>
<amq:map>
<amq:authorizationMap>
<amq:authorizationEntries>
<amq:authorizationEntry queue=">" read="users" write="users" admin="users" />
<amq:authorizationEntry topic=">" read="users" write="users" admin="users" />
</amq:authorizationEntries>
</amq:authorizationMap>
</amq:map>
</amq:authorizationPlugin>
</amq:plugins>

<amq:systemUsage>
<amq:systemUsage>
<amq:memoryUsage>
<amq:memoryUsage limit="3 gb" />
</amq:memoryUsage>
<amq:storeUsage>
<amq:storeUsage limit="10 gb" />
</amq:storeUsage>
<amq:tempUsage>
<amq:tempUsage limit="2 gb" />
</amq:tempUsage>
</amq:systemUsage>
</amq:systemUsage>

<amq:transportConnectors>
<amq:transportConnector uri="tcp://${activemq.transport.host}:${activemq.transport.port}" discoveryUri="multicast://${activemq.network.multicast.address}:${activemq.network.multicast.port}?group=${activemq.network.multicast.group}" />
<amq:transportConnector uri="vm://${activemq.broker.name}" />
</amq:transportConnectors>

</amq:broker>

你们中的任何人是否有一些关于以下方面的指示:
  • 为什么 activemq 不断尝试添加已经存在的连接?
  • 为什么要记录这个,为什么只在警告级别?没有其他信息
    (堆栈跟踪)已记录
  • 这真的是个问题吗,因为队列处理不受影响并且一切正常?

  • 期待您的回复,

    最佳答案

    查看ActiveMQ 5.10.2的源代码,字符串Failed to add Connection出现了一次在 TransportConnection.java :

    try {
    broker.addConnection(context, info);
    } catch (Exception e) {
    synchronized (brokerConnectionStates) {
    brokerConnectionStates.remove(info.getConnectionId());
    }
    unregisterConnectionState(info.getConnectionId());
    LOG.warn("Failed to add Connection {}", info.getConnectionId(), e);
    if (e instanceof SecurityException) {
    // close this down - in case the peer of this transport doesn't play nice
    delayedStop(2000, "Failed with SecurityException: " + e.getLocalizedMessage(), e);
    }
    throw e;
    }

    您的警告是由异常引起的,并且尝试的连接未注册。此时,我会检查配置文件并禁用所有不需要的服务和端口。

    你能分享你的配置文件吗?

    关于apache-camel - ActiveMQ 5.10.2 : [org. apache.activemq.broker.TransportConnection] TransportConnection (triggerStartAsyncNetworkBridgeCreation:Failed to add Connection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59201631/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com