当前位置: 首页 > 知识库问答 >
问题:

Spring集成Jms ActiveMQ

常心水
2023-03-14

在我们的应用程序中,我们使用Spring与ActiveMQ集成。我们面临一个问题,例如每当ActiveMQ服务器关闭时,应用程序都会抛出:

 Caused by: javax.jms.JMSException : Could not connect to broker URL: tcp://localhost:61616?wireFormat.maxInactivityDuration=300000. Reason: java.net.ConnectException: Connection refused: connect
org.apache.activemq.util.JMSExceptionSupport!create!JMSExceptionSupport.java!35
org.apache.activemq.ActiveMQConnectionFactory!createActiveMQConnection!ActiveMQConnectionFactory.java!293
org.apache.activemq.ActiveMQConnectionFactory!createActiveMQConnection!ActiveMQConnectionFactory.java!238
org.apache.activemq.ActiveMQConnectionFactory!createConnection!ActiveMQConnectionFactory.java!184
org.apache.activemq.pool.PooledConnectionFactory!createConnection!PooledConnectionFactory.java!247
org.apache.activemq.pool.PooledConnectionFactory$1!makeObject!PooledConnectionFactory.java!131
org.apache.activemq.pool.PooledConnectionFactory$1!makeObject!PooledConnectionFactory.java!111
org.apache.commons.pool.impl.GenericKeyedObjectPool!borrowObject!GenericKeyedObjectPool.java!1220
org.apache.activemq.pool.PooledConnectionFactory!createConnection!PooledConnectionFactory.java!224
org.apache.activemq.pool.PooledConnectionFactory!createConnection!PooledConnectionFactory.java!195
org.springframework.jms.support.JmsAccessor!createConnection!JmsAccessor.java!184
org.springframework.jms.core.JmsTemplate!execute!JmsTemplate.java!456
org.springframework.jms.core.JmsTemplate!send!JmsTemplate.java!534
org.springframework.jms.core.JmsTemplate!convertAndSend!JmsTemplate.java!641
org.springframework.integration.jms.JmsSendingMessageHandler!send!JmsSendingMessageHandler.java!139
org.springframework.integration.jms.JmsSendingMessageHandler!handleMessageInternal!JmsSendingMessageHandler.java!112
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!128
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!128
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!306
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!299
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain$1!send!MessageHandlerChain.java!154
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain!handleMessageInternal!MessageHandlerChain.java!137
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.interceptor.WireTap!preSend!WireTap.java!121
org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList!preSend!AbstractMessageChannel.java!227
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!152
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!306
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!299
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain$1!send!MessageHandlerChain.java!154
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain!handleMessageInternal!MessageHandlerChain.java!137
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!128
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!doSendAndReceive!MessagingTemplate.java!318
org.springframework.integration.core.MessagingTemplate!sendAndReceive!MessagingTemplate.java!239
org.springframework.integration.core.MessagingTemplate!convertSendAndReceive!MessagingTemplate.java!274
org.springframework.integration.gateway.MessagingGatewaySupport!doSendAndReceive!MessagingGatewaySupport.java!224
org.springframework.integration.gateway.MessagingGatewaySupport!sendAndReceive!MessagingGatewaySupport.java!203
org.springframework.integration.gateway.GatewayProxyFactoryBean!invokeGatewayMethod!GatewayProxyFactoryBean.java!306
org.springframework.integration.gateway.GatewayProxyFactoryBean!doInvoke!GatewayProxyFactoryBean.java!269
org.springframework.integration.gateway.GatewayProxyFactoryBean!invoke!GatewayProxyFactoryBean.java!260
org.springframework.aop.framework.ReflectiveMethodInvocation!proceed!ReflectiveMethodInvocation.java!172
org.springframework.aop.framework.JdkDynamicAopProxy!invoke!JdkDynamicAopProxy.java!202
com.sun.proxy.$Proxy50!getLocationDetails!null!-1
sun.reflect.NativeMethodAccessorImpl!invoke0!NativeMethodAccessorImpl.java!-2
sun.reflect.NativeMethodAccessorImpl!invoke!NativeMethodAccessorImpl.java!39
sun.reflect.DelegatingMethodAccessorImpl!invoke!DelegatingMethodAccessorImpl.java!25
java.lang.reflect.Method!invoke!Method.java!597
org.apache.cxf.service.invoker.AbstractInvoker!performInvocation!AbstractInvoker.java!180
org.apache.cxf.service.invoker.AbstractInvoker!invoke!AbstractInvoker.java!96
org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker!invoke!AbstractJAXWSMethodInvoker.java!178
org.apache.cxf.jaxws.JAXWSMethodInvoker!invoke!JAXWSMethodInvoker.java!66
org.apache.cxf.service.invoker.AbstractInvoker!invoke!AbstractInvoker.java!75
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1!run!ServiceInvokerInterceptor.java!58
java.util.concurrent.Executors$RunnableAdapter!call!Executors.java!439
java.util.concurrent.FutureTask$Sync!innerRun!FutureTask.java!303
java.util.concurrent.FutureTask!run!FutureTask.java!138
org.apache.cxf.workqueue.SynchronousExecutor!execute!SynchronousExecutor.java!37
org.apache.cxf.interceptor.ServiceInvokerInterceptor!handleMessage!ServiceInvokerInterceptor.java!107
org.apache.cxf.phase.PhaseInterceptorChain!doIntercept!PhaseInterceptorChain.java!262
org.apache.cxf.transport.ChainInitiationObserver!onMessage!ChainInitiationObserver.java!121
org.apache.cxf.transport.http.AbstractHTTPDestination!invoke!AbstractHTTPDestination.java!237
org.apache.cxf.transport.servlet.ServletController!invokeDestination!ServletController.java!209
org.apache.cxf.transport.servlet.ServletController!invoke!ServletController.java!189
org.apache.cxf.transport.servlet.CXFNonSpringServlet!invoke!CXFNonSpringServlet.java!130
org.apache.cxf.transport.servlet.AbstractHTTPServlet!handleRequest!AbstractHTTPServlet.java!225
org.apache.cxf.transport.servlet.AbstractHTTPServlet!doPost!AbstractHTTPServlet.java!145
javax.servlet.http.HttpServlet!service!HttpServlet.java!647
org.apache.cxf.transport.servlet.AbstractHTTPServlet!service!AbstractHTTPServlet.java!201
org.apache.catalina.core.ApplicationFilterChain!internalDoFilter!ApplicationFilterChain.java!305
org.apache.catalina.core.ApplicationFilterChain!doFilter!ApplicationFilterChain.java!210
org.apache.catalina.core.StandardWrapperValve!invoke!StandardWrapperValve.java!222
org.apache.catalina.core.StandardContextValve!invoke!StandardContextValve.java!123
org.apache.catalina.authenticator.AuthenticatorBase!invoke!AuthenticatorBase.java!502
org.apache.catalina.core.StandardHostValve!invoke!StandardHostValve.java!171
org.apache.catalina.valves.ErrorReportValve!invoke!ErrorReportValve.java!100
org.apache.catalina.valves.AccessLogValve!invoke!AccessLogValve.java!953
org.apache.catalina.core.StandardEngineValve!invoke!StandardEngineValve.java!118
org.apache.catalina.connector.CoyoteAdapter!service!CoyoteAdapter.java!408
org.apache.coyote.http11.AbstractHttp11Processor!process!AbstractHttp11Processor.java!1041
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler!process!AbstractProtocol.java!603
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor!doRun!AprEndpoint.java!2430
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor!run!AprEndpoint.java!2419
java.util.concurrent.ThreadPoolExecutor$Worker!runTask!ThreadPoolExecutor.java!895
java.util.concurrent.ThreadPoolExecutor$Worker!run!ThreadPoolExecutor.java!918
java.lang.Thread!run!Thread.java!662
Caused by: java.net.ConnectException : Connection refused: connect
java.net.PlainSocketImpl!socketConnect!PlainSocketImpl.java!-2
java.net.PlainSocketImpl!doConnect!PlainSocketImpl.java!351
java.net.PlainSocketImpl!connectToAddress!PlainSocketImpl.java!213
java.net.PlainSocketImpl!connect!PlainSocketImpl.java!200
java.net.SocksSocketImpl!connect!SocksSocketImpl.java!366
java.net.Socket!connect!Socket.java!529
org.apache.activemq.transport.tcp.TcpTransport!connect!TcpTransport.java!496
org.apache.activemq.transport.tcp.TcpTransport!doStart!TcpTransport.java!459
org.apache.activemq.util.ServiceSupport!start!ServiceSupport.java!55
org.apache.activemq.transport.AbstractInactivityMonitor!start!AbstractInactivityMonitor.java!140
org.apache.activemq.transport.TransportFilter!start!TransportFilter.java!58
org.apache.activemq.transport.WireFormatNegotiator!start!WireFormatNegotiator.java!72
org.apache.activemq.transport.TransportFilter!start!TransportFilter.java!58
org.apache.activemq.transport.TransportFilter!start!TransportFilter.java!58
org.apache.activemq.ActiveMQConnectionFactory!createActiveMQConnection!ActiveMQConnectionFactory.java!273
org.apache.activemq.ActiveMQConnectionFactory!createActiveMQConnection!ActiveMQConnectionFactory.java!238
org.apache.activemq.ActiveMQConnectionFactory!createConnection!ActiveMQConnectionFactory.java!184
org.apache.activemq.pool.PooledConnectionFactory!createConnection!PooledConnectionFactory.java!247
org.apache.activemq.pool.PooledConnectionFactory$1!makeObject!PooledConnectionFactory.java!131
org.apache.activemq.pool.PooledConnectionFactory$1!makeObject!PooledConnectionFactory.java!111
org.apache.commons.pool.impl.GenericKeyedObjectPool!borrowObject!GenericKeyedObjectPool.java!1220
org.apache.activemq.pool.PooledConnectionFactory!createConnection!PooledConnectionFactory.java!224
org.apache.activemq.pool.PooledConnectionFactory!createConnection!PooledConnectionFactory.java!195
org.springframework.jms.support.JmsAccessor!createConnection!JmsAccessor.java!184
org.springframework.jms.core.JmsTemplate!execute!JmsTemplate.java!456
org.springframework.jms.core.JmsTemplate!send!JmsTemplate.java!534
org.springframework.jms.core.JmsTemplate!convertAndSend!JmsTemplate.java!641
org.springframework.integration.jms.JmsSendingMessageHandler!send!JmsSendingMessageHandler.java!139
org.springframework.integration.jms.JmsSendingMessageHandler!handleMessageInternal!JmsSendingMessageHandler.java!112
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!128
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!128
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!306
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!299
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain$1!send!MessageHandlerChain.java!154
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain!handleMessageInternal!MessageHandlerChain.java!137
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115
org.springframework.integration.dispatcher.UnicastingDispatcher!dispatch!UnicastingDispatcher.java!102
org.springframework.integration.channel.AbstractSubscribableChannel!doSend!AbstractSubscribableChannel.java!77
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!157
org.springframework.integration.channel.interceptor.WireTap!preSend!WireTap.java!121
org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList!preSend!AbstractMessageChannel.java!227
org.springframework.integration.channel.AbstractMessageChannel!send!AbstractMessageChannel.java!152
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!306
org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel!send!MessageHandlerChain.java!299
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendMessage!AbstractReplyProducingMessageHandler.java!216
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!sendReplyMessage!AbstractReplyProducingMessageHandler.java!200
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141
org.springframework.integration.handler.AbstractMessageHandler!handleMessage!AbstractMessageHandler.java!73
org.springframework.integration.handler.MessageHandlerChain$1!send!MessageHandlerChain.java!154
org.springframework.integration.core.MessagingTemplate!doSend!MessagingTemplate.java!288
org.springframework.integration.core.MessagingTemplate!send!MessagingTemplate.java!149

org.springframework.integration.handler.AbstractReplyProducingMessageHandler!produceReply!AbstractReplyProducingMessageHandler.java!165
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleResult!AbstractReplyProducingMessageHandler.java!159
org.springframework.integration.handler.AbstractReplyProducingMessageHandler!handleMessageInternal!AbstractReplyProducingMessageHandler.java!141

org.springframework.integration.dispatcher.UnicastingDispatcher!doDispatch!UnicastingDispatcher.java!115

你能建议如何让我的应用程序在ActiveMQ关闭的情况下运行吗

请在下面找到ActiveMQ配置:

<!-- ======================================== -->
<!-- JMS CONFIG. -->
<!-- ======================================== -->
<!-- a pooling based JMS provider -->
<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
    <property name="connectionFactory" ref="connectionFactory" />
</bean>
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL">
        <value>${messagecentral.broker.url}</value>
    </property>
</bean>

<!-- JMS Queue from accounts PBB -->
<bean id="messageCentralAccountsQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <!-- name of the queue in ActiveMQ -->
    <constructor-arg value="messagecentral.accountspbb" />
</bean>

<bean id="messageCentralCardsQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <!-- name of the queue in ActiveMQ -->
    <constructor-arg value="messagecentral.cardspbb" />
</bean>

共有2个答案

胡禄
2023-03-14

当一台activemq服务器关闭时,您还可以使用故障转移属性连接到另一台activemq服务器。您也可以使用此链接。可以使用主从服务器http://activemq.apache.org/failover-transport-reference.html

赵景曜
2023-03-14

另外,请显示JMS内容的Spring集成配置。更多的StackTrace也会很好。

我的意思是,也许用自动启动="false"标记您的适配器就足够了,您的应用程序会很好地启动。

 类似资料:
  • 我是spring集成和缓存新手,想知道如何将从出站网关接收到的对象添加到缓存中。无法确定所需的配置。 从以下配置,我从rest api收到的对象正在被记录: INFO:com.domain.IpAddress@74589991 我计划使用ehcache/caffiene,任何提示都会有帮助。 编辑2: 现在,我按照建议更改了出站网关: 并将ehache配置定义如下: 在我的服务类中,定义了可缓存的

  • Spring提供了特殊的类DelegatingVariableResolver,以无缝方式将JSF和Spring集成在一起。 在JSF中集成Spring依赖注入(IOC)功能需要以下步骤。 第1步:添加DelegatingVariableResolver 在faces-config.xml中添加一个variable-resolver条目,指向spring类DelegatingVariableRes

  • 主要内容:AspectJ Jar 包下载我们知道,Spring AOP 是一个简化版的 AOP 实现,并没有提供完整版的 AOP 功能。通常情况下,Spring AOP 是能够满足我们日常开发过程中的大多数场景的,但在某些情况下,我们可能需要使用 Spring AOP 范围外的某些 AOP 功能。 例如 Spring AOP 仅支持执行公共(public)非静态方法的调用作为连接点,如果我们需要向受保护的(protected)或私有的(

  • 我正在尝试从JMS队列(使用ActiveMQ)读取消息。我面临的问题是,消息正在从队列中读取,但没有显示在“服务激活器”中。 非常感谢您的帮助。 我的代码如下: (1) Spring配置 (2) 服务激活器MDP: (3) 申请开始课程: 谢谢

  • 我无法解决这个问题,现在已经坚持了很长时间。我是一个spring-integration-dsl的初学者,任何帮助都将非常感谢。

  • 我正在使用GWT和Spring集成为控制台编写代码。我已经学习了GWT教程,并阅读了一些关于如何使用spring qith GWT的论坛。 服务: 异步: Impl: 编辑:如果有用,这里是错误: com.google.gwt.user.server.rpc.unceptionedException:服务方法'public abstract java.util.collection com.san

  • 虽然没有Spring你也可以使用Activiti,但是我们提供了一些非常不错的集成特性。这一章我们将介绍这些特性。 ProcessEngineFactoryBean 可以把流程引擎(ProcessEngine)作为一个普通的Spring bean进行配置。 类 org.activiti.spring.ProcessEngineFactoryBean是集成的切入点。 这个bean需要一个流程引擎配置

  • 1.1 Spring 集成 这是 elasticsearch-rest-plus最常用的一种的环境。通用 elasticsearch-rest-plus提供了多种方式来和 Spring 进行集成。 1.1.1 添加依赖 在开始配置前,先添加相关的依赖。 正常情况下,Spring 和 elasticsearch-rest-plus的集成环境中,应该已经存在下面的依赖: <dependency>