- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遇到了 ActiveMQ 故障转移传输问题。我正在使用 Spring (3.0.5) 和 ActiveMQ (5.2.0)。我想使用 ActiveMQ 主题来广播一些消息。我的配置如下所示:
jms-context.xml
我正在创建简单的 ActiveMQConnectionFactory
,它使用异步发送并用 PooledConnetionFactory
包装它,以便以后的 JMSTemplate
可以重用池连接。
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:amq="http://activemq.apache.org/schema/core"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd
">
<!-- JMS -->
<amq:connectionFactory id="jmsTopicAsyncConnectionFactory" brokerURL="${jms.url}">
<property name="useAsyncSend" value="true"/>
</amq:connectionFactory>
<bean id="pooledJmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<constructor-arg ref="jmsTopicAsyncConnectionFactory" />
</bean>
</beans>
JMSConfig.java
在 java 配置中,我使用池连接工厂定义 JmsTemplate 实例。
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Scope;
import org.springframework.jms.core.JmsTemplate;
@Configuration
@ImportResource("classpath:jms-context.xml")
public class JmsConfig {
/**
* Used for sending messages to broadcast topics.
*
* @param pooledJmsConnectionFactory JMS connection factory.
* @return JMS template instance.
*/
@Bean
@Autowired
@Scope(value=BeanDefinition.SCOPE_PROTOTYPE)
public JmsTemplate jmsTemplate(@Qualifier("pooledJmsConnectionFactory") ConnectionFactory pooledJmsConnectionFactory) {
return new JmsTemplate(pooledJmsConnectionFactory);
}
}
Broadcaster.java
然后我在广播类中注入(inject)之前创建的JmsTemplate
。
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
public class ConcreteBroadcaster implements Broadcaster {
private Logger log = LoggerFactory.getLogger(ConcreteBroadcaster.class);
@Autowired
private JmsTemplate template;
private final Destination destination;
public ConcreteBroadcaster(Destination destination) {
this.destination = destination;
}
/**
* Broadcasts event.
*/
@Override
public void broadcast(final Event event) {
template.send(destination, new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
final Message eventMessage = session.createObjectMessage(event);
if (log.isDebugEnabled()) {
log.debug("Broadcasting event {} through JMS topic {}", event.getClass().getSimpleName(), destination);
}
return eventMessage;
}
});
}
}
当只有一个 ActiveMQ 代理时,一切正常。当我将 jms.url
更改为:
jms.url: "tcp://10.0.0.1:61616"
到:
jms.url: "故障转移:(tcp://10.0.0.1:61616,tcp://10.0.0.2:61616)?randomize=false"
然后在给定主机上使用默认配置运行两个 ActiveMQ 代理,我的应用程序启动并向我发送以下日志:
16 Feb 2015 16:37:40,491 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 16:37:41,499 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 16:37:42,508 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 16:37:43,514 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 16:37:44,522 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
所以似乎每秒都会重新连接一次。当我启用 DEBUG 日志记录时,它看起来像这样:
16 Feb 2015 19:46:25,050 DEBUG ache.activemq.transport.failover.FailoverTransport - urlList connectionList:[tcp://10.0.0.1:61616, tcp://10.0.0.2:61616], from: [tcp://10.0.0.1:61616, tcp://10.0.0.2:61616]
16 Feb 2015 19:46:25,051 DEBUG ache.activemq.transport.failover.FailoverTransport - Attempting 0th connect to: tcp://10.0.0.1:61616
16 Feb 2015 19:46:25,053 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:25,053 DEBUG ache.activemq.transport.failover.FailoverTransport - Connection established
16 Feb 2015 19:46:25,053 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 19:46:25,056 DEBUG org.apache.activemq.transport.InactivityMonitor - Using min of local: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]} and remote: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:25,056 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Received WireFormat: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:25,056 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40113 before negotiation: OpenWireFormat{version=9, cacheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:25,057 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40113 after negotiation: OpenWireFormat{version=5, cacheEnabled=true, stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:25,064 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Session Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@46abe3f3[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:26,065 DEBUG org.apache.activemq.ActiveMQMessageConsumer - remove: ID:dev.vagrant.local-33222-1424101620085-1:6862:1:1, lastDeliveredSequenceId:0
16 Feb 2015 19:46:26,066 DEBUG org.apache.activemq.ActiveMQSession - ID:dev.vagrant.local-33222-1424101620085-1:6862:1 Transaction Commit :null
16 Feb 2015 19:46:26,068 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@46abe3f3[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:26,069 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@228b3f4c[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:26,069 DEBUG ache.activemq.transport.failover.FailoverTransport - Stopped tcp://10.0.0.1:61616
16 Feb 2015 19:46:26,070 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@565b26a9[Running, pool size = 2, active threads = 0, queued tasks = 0, completed tasks = 2]
16 Feb 2015 19:46:26,071 DEBUG org.apache.activemq.transport.tcp.TcpTransport - Stopping transport tcp:///10.0.0.1:61616@40113
16 Feb 2015 19:46:26,071 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@74e8dd0c[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:26,072 DEBUG org.apache.activemq.transport.tcp.TcpTransport$1 - Closed socket Socket[addr=/10.0.0.1,port=61616,localport=40113]
16 Feb 2015 19:46:26,072 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@74e8dd0c[Running, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:26,073 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@3a0a1c78[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:26,074 DEBUG ache.activemq.transport.failover.FailoverTransport - Reconnect was triggered but transport is not started yet. Wait for start to connect the transport.
16 Feb 2015 19:46:26,074 DEBUG ache.activemq.transport.failover.FailoverTransport - Started unconnected
16 Feb 2015 19:46:26,074 DEBUG ache.activemq.transport.failover.FailoverTransport - Waking up reconnect task
16 Feb 2015 19:46:26,075 DEBUG ache.activemq.transport.failover.FailoverTransport - urlList connectionList:[tcp://10.0.0.1:61616, tcp://10.0.0.2:61616], from: [tcp://10.0.0.1:61616, tcp://10.0.0.2:61616]
16 Feb 2015 19:46:26,076 DEBUG ache.activemq.transport.failover.FailoverTransport - Attempting 0th connect to: tcp://10.0.0.1:61616
16 Feb 2015 19:46:26,077 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:26,077 DEBUG ache.activemq.transport.failover.FailoverTransport - Connection established
16 Feb 2015 19:46:26,077 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 19:46:26,082 DEBUG org.apache.activemq.transport.InactivityMonitor - Using min of local: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]} and remote: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:26,083 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Received WireFormat: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:26,083 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40114 before negotiation: OpenWireFormat{version=9, cacheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:26,083 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40114 after negotiation: OpenWireFormat{version=5, cacheEnabled=true, stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:26,093 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Session Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@6d0c65b0[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:27,094 DEBUG org.apache.activemq.ActiveMQMessageConsumer - remove: ID:dev.vagrant.local-33222-1424101620085-1:6863:1:1, lastDeliveredSequenceId:0
16 Feb 2015 19:46:27,096 DEBUG org.apache.activemq.ActiveMQSession - ID:dev.vagrant.local-33222-1424101620085-1:6863:1 Transaction Commit :null
16 Feb 2015 19:46:27,098 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@6d0c65b0[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:27,098 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@76d73f47[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:27,099 DEBUG ache.activemq.transport.failover.FailoverTransport - Stopped tcp://10.0.0.1:61616
16 Feb 2015 19:46:27,100 DEBUG org.apache.activemq.transport.tcp.TcpTransport - Stopping transport tcp:///10.0.0.1:61616@40114
16 Feb 2015 19:46:27,100 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@1ffc55fd[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:27,101 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@3a0a1c78[Running, pool size = 2, active threads = 0, queued tasks = 0, completed tasks = 2]
16 Feb 2015 19:46:27,102 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@5a12ff9c[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:27,103 DEBUG ache.activemq.transport.failover.FailoverTransport - Reconnect was triggered but transport is not started yet. Wait for start to connect the transport.
16 Feb 2015 19:46:27,103 DEBUG ache.activemq.transport.failover.FailoverTransport - Started unconnected
16 Feb 2015 19:46:27,104 DEBUG ache.activemq.transport.failover.FailoverTransport - Waking up reconnect task
16 Feb 2015 19:46:27,103 DEBUG org.apache.activemq.transport.tcp.TcpTransport$1 - Closed socket Socket[addr=/10.0.0.1,port=61616,localport=40114]
16 Feb 2015 19:46:27,104 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@1ffc55fd[Running, pool size = 1, active threads = 0, queued tasks = 0, completed tasks = 1]
16 Feb 2015 19:46:27,105 WARN ache.activemq.transport.failover.FailoverTransport - Transport (tcp://10.0.0.1:61616) failed, reason: java.io.EOFException, not attempting to automatically reconnect
16 Feb 2015 19:46:27,105 DEBUG org.apache.activemq.ActiveMQConnection - transport interrupted, dispatchers: 0
16 Feb 2015 19:46:27,105 DEBUG org.apache.activemq.ActiveMQConnection - notified failover transport (unconnected) of pending interruption processing for: ID:dev.vagrant.local-33222-1424101620085-1:6863
16 Feb 2015 19:46:27,106 DEBUG ache.activemq.transport.failover.FailoverTransport - urlList connectionList:[tcp://10.0.0.1:61616, tcp://10.0.0.2:61616], from: [tcp://10.0.0.1:61616, tcp://10.0.0.2:61616]
16 Feb 2015 19:46:27,107 DEBUG ache.activemq.transport.failover.FailoverTransport - Attempting 0th connect to: tcp://10.0.0.1:61616
16 Feb 2015 19:46:27,109 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:27,109 DEBUG ache.activemq.transport.failover.FailoverTransport - Connection established
16 Feb 2015 19:46:27,109 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 19:46:27,113 DEBUG org.apache.activemq.transport.InactivityMonitor - Using min of local: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]} and remote: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:27,114 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Received WireFormat: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:27,114 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40115 before negotiation: OpenWireFormat{version=9, cacheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:27,114 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40115 after negotiation: OpenWireFormat{version=5, cacheEnabled=true, stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:27,121 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Session Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@1cf53b77[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:28,123 DEBUG org.apache.activemq.ActiveMQMessageConsumer - remove: ID:dev.vagrant.local-33222-1424101620085-1:6864:1:1, lastDeliveredSequenceId:0
16 Feb 2015 19:46:28,124 DEBUG org.apache.activemq.ActiveMQSession - ID:dev.vagrant.local-33222-1424101620085-1:6864:1 Transaction Commit :null
16 Feb 2015 19:46:28,126 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@1cf53b77[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:28,127 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@39d64d12[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:28,128 DEBUG ache.activemq.transport.failover.FailoverTransport - Stopped tcp://10.0.0.1:61616
16 Feb 2015 19:46:28,128 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@5a12ff9c[Running, pool size = 2, active threads = 0, queued tasks = 0, completed tasks = 2]
16 Feb 2015 19:46:28,129 DEBUG org.apache.activemq.transport.tcp.TcpTransport - Stopping transport tcp:///10.0.0.1:61616@40115
16 Feb 2015 19:46:28,130 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@372d510a[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:28,130 DEBUG org.apache.activemq.transport.tcp.TcpTransport$1 - Closed socket Socket[addr=/10.0.0.1,port=61616,localport=40115]
16 Feb 2015 19:46:28,131 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@372d510a[Running, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:28,131 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@3cbab1f9[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:28,131 DEBUG ache.activemq.transport.failover.FailoverTransport - Reconnect was triggered but transport is not started yet. Wait for start to connect the transport.
16 Feb 2015 19:46:28,132 DEBUG ache.activemq.transport.failover.FailoverTransport - Started unconnected
16 Feb 2015 19:46:28,133 DEBUG ache.activemq.transport.failover.FailoverTransport - Waking up reconnect task
16 Feb 2015 19:46:28,133 DEBUG ache.activemq.transport.failover.FailoverTransport - urlList connectionList:[tcp://10.0.0.1:61616, tcp://10.0.0.2:61616], from: [tcp://10.0.0.1:61616, tcp://10.0.0.2:61616]
16 Feb 2015 19:46:28,134 DEBUG ache.activemq.transport.failover.FailoverTransport - Attempting 0th connect to: tcp://10.0.0.1:61616
16 Feb 2015 19:46:28,136 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:28,136 DEBUG ache.activemq.transport.failover.FailoverTransport - Connection established
16 Feb 2015 19:46:28,136 INFO ache.activemq.transport.failover.FailoverTransport - Successfully connected to tcp://10.0.0.1:61616
16 Feb 2015 19:46:28,142 DEBUG org.apache.activemq.transport.InactivityMonitor - Using min of local: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]} and remote: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:28,144 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Received WireFormat: WireFormatInfo { version=5, properties={CacheSize=1024, SizePrefixDisabled=false, TcpNoDelayEnabled=true, MaxInactivityDurationInitalDelay=10000, MaxInactivityDuration=30000, CacheEnabled=true, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
16 Feb 2015 19:46:28,144 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40116 before negotiation: OpenWireFormat{version=9, cacheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:28,144 DEBUG org.apache.activemq.transport.WireFormatNegotiator - tcp:///10.0.0.1:61616@40116 after negotiation: OpenWireFormat{version=5, cacheEnabled=true, stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false, maxFrameSize=9223372036854775807}
16 Feb 2015 19:46:28,155 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Session Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@5e95c519[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:28,394 DEBUG che.activemq.transport.AbstractInactivityMonitor$2 - WriteChecker 10000 ms elapsed since last write check.
16 Feb 2015 19:46:29,156 DEBUG org.apache.activemq.ActiveMQMessageConsumer - remove: ID:dev.vagrant.local-33222-1424101620085-1:6865:1:1, lastDeliveredSequenceId:0
16 Feb 2015 19:46:29,157 DEBUG org.apache.activemq.ActiveMQSession - ID:dev.vagrant.local-33222-1424101620085-1:6865:1 Transaction Commit :null
16 Feb 2015 19:46:29,160 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@5e95c519[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:29,160 DEBUG org.apache.activemq.util.ThreadPoolUtils - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@5af5d17a[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] is shutdown: true and terminated: true took: 0.000 seconds.
16 Feb 2015 19:46:29,160 DEBUG ache.activemq.transport.failover.FailoverTransport - Stopped tcp://10.0.0.1:61616
16 Feb 2015 19:46:29,162 DEBUG org.apache.activemq.transport.tcp.TcpTransport - Stopping transport tcp:///10.0.0.1:61616@40116
16 Feb 2015 19:46:29,162 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@5b20212e[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:29,163 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@3cbab1f9[Running, pool size = 2, active threads = 0, queued tasks = 0, completed tasks = 2]
16 Feb 2015 19:46:29,164 DEBUG org.apache.activemq.thread.TaskRunnerFactory - Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: java.util.concurrent.ThreadPoolExecutor@6331ee[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
16 Feb 2015 19:46:29,164 DEBUG ache.activemq.transport.failover.FailoverTransport - Reconnect was triggered but transport is not started yet. Wait for start to connect the transport.
16 Feb 2015 19:46:29,165 DEBUG ache.activemq.transport.failover.FailoverTransport - Started unconnected
16 Feb 2015 19:46:29,165 DEBUG ache.activemq.transport.failover.FailoverTransport - Waking up reconnect task
16 Feb 2015 19:46:29,165 DEBUG org.apache.activemq.transport.tcp.TcpTransport$1 - Closed socket Socket[addr=/10.0.0.1,port=61616,localport=40116]
16 Feb 2015 19:46:29,166 DEBUG org.apache.activemq.util.ThreadPoolUtils - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@5b20212e[Running, pool size = 1, active threads = 0, queued tasks = 0, completed tasks = 1]
16 Feb 2015 19:46:29,166 WARN ache.activemq.transport.failover.FailoverTransport - Transport (tcp://10.0.0.1:61616) failed, reason: java.io.EOFException, not attempting to automatically reconnect
16 Feb 2015 19:46:29,167 DEBUG org.apache.activemq.ActiveMQConnection - transport interrupted, dispatchers: 0
16 Feb 2015 19:46:29,167 DEBUG org.apache.activemq.ActiveMQConnection - notified failover transport (unconnected) of pending interruption processing for: ID:dev.vagrant.local-33222-1424101620085-1:6865
16 Feb 2015 19:46:29,167 DEBUG ache.activemq.transport.failover.FailoverTransport - urlList connectionList:[tcp://10.0.0.1:61616, tcp://10.0.0.2:61616], from: [tcp://10.0.0.1:61616, tcp://10.0.0.2:61616]
我不知道哪里出了问题,请帮忙。
最佳答案
1 秒后似乎有东西关闭了连接;打开 TRACE 级别的日志记录;池化连接工厂在启用后会输出更多日志。
或者,尝试使用 Spring 的 CachingConnectionFactory
而不是 PooledConnectionFactory
。
关于spring - ActiveMQ Failover transport + Spring JmsTemplate 常量重连,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28547581/
当我使用 log4j 2.1 编译我的 spring 3.2.9 web 应用程序时,这个错误出现在控制台中: 2015-02-02 12:08:25,213 ERROR appender Failo
在 LMAX Disruptor模式中,复制器用于将输入事件从主节点复制到从节点。因此设置可能如下所示: 主节点的复制器将事件写入数据库(尽管我们可以想到比写入数据库更好的机制 - 这对于问题陈述来说
Hazelcast 文档指出 If a member goes down, its backup replica that also holds the same data, will dynamic
我正在将 Azure 移动服务用于生产移动应用程序。我正在查看 Azure 门户中的故障转移配置,但找不到任何相关信息。 有“流量管理器”,如 Azure documentation 中所述。 。但根
RabbitMQ 默认支持集群,但队列不会被复制,而是绑定(bind)到创建它们的节点。我现在正在寻找除了他们记录的 DRBD 解决方案之外使 RabbitMQ 高度可用的方法,因为保留整个服务器除了
我有以下 MySQL 实例以及复制设置: S1 -----> (M1 M2),其中: M1 - M2 是一个多主复制设置, S1 - 复制在主 M1 上完成的写入的从站。 现在,我正在尝试使用 ch
我遇到的情况是,如果节点发生故障,我必须保持 session 粘性。配置为: 三个节点(as1、as2、as3)在 JBoss 4.2.3(同构集群)上运行我们的企业应用程序 HAProxy 为每个节
我已经创建了一个 Redis 集群,如下所示。 xxx.xxx.xxx.195:9100 xxx.xxx.xxx.196:9100 xxx.xxx.xxx.197:9100 xxx.xxx
我有一个使用 Selenium-RC 和 TestNG 用 Java 编写的测试套件 - public class testSuite extends SelenestTestCase { @Be
MySQL 是否带有内置的自动故障转移功能?或者,是否有负载平衡器可以“检测”数据库是否处于事件状态……如果不存在……将其发送到故障转移数据库? 我知道基本的 MySQL,但不知道为一个主数据库设计故
我正在尝试用 6 台机器实现一个 Redis 集群。我有一个由六台机器组成的 vagrant 集群: 192.168.56.101 192.168.56.102 192.168.56.103 192.
我遇到了 ActiveMQ 故障转移传输问题。我正在使用 Spring (3.0.5) 和 ActiveMQ (5.2.0)。我想使用 ActiveMQ 主题来广播一些消息。我的配置如下所示: jms
从 System.Data.OracleClient 转换为 ODB.NET,需要帮助转换我的连接字符串。这是我与 System.Data.OracleClient 一起使用的内容。 SERVER=(
我正在使用 Apache 和 tomcat 来设置负载平衡和故障转移。最初我以为 load-balancing 会包括 fail-over,但我错了。我认为如果一个实例不活动,那么使用其他实例也会成为
我们正在尝试连接到启用了数据库镜像的 SQL。我们有 2 个服务器:DB1(主体)和 DB2(镜像)。 我们正在使用连接字符串: Provider=SQLOLEDB;Data Source=DB1;F
提前谢谢您... 我创建了一个故障转移组并想要测试故障转移。我通过故障转移组选项卡强制进行故障转移,它表示已成功,并且辅助数据库现在是主数据库。但是,当我尝试写入它时,我收到此错误: 错误: [Mic
使用 DefaultJmsListenerContainerFactory 订阅消息时在使用故障转移 activemq 传输的 spring 和 Camel 中,我不断收到低于 INFO 消息的消息。
我们使用 Azure TrafficManager,并且我们有某些端点想要检查传入调用的来源/引用域(无论如何,原始 IP 在云中都是一个坏主意)我想知道 TrafficManager 是否或如何
我希望能够随时升级我的硬件,而不会中断我的网络应用程序,即随时关闭其中一台计算机,交换/升级它,重新插入它,并进行设置,以便它获得一切返回,包括另一台计算机上发生的所有磁盘更改,同时 wep 应用程序
因此,我正在使用一些本地虚拟机测试一些玩具 postgresql 基础设施,以确定 pgpool 在故障转移时的行为方式。我已经配置了一个基本设置,其中我有两台数据库机器(192.168.0.2 和
我是一名优秀的程序员,十分优秀!