- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Spring 集成的新手,正在尝试建模一个流程,其中我通过 HTTP 进行同步请求和响应,但也是交付的同一流程的一部分将响应发送到队列,对其进行后处理,并让一个单独的进程使用该响应。所以从调用流程的客户端来看是同步的;在响应被放置到队列上的点处从流内异步。我在嵌入式 Jetty 服务器中托管 gateway-context.xml 和 amqp-context.xml并通过下面的 HttpAmqpClientDemo 从单独的进程发布。
我能够提交请求并收到响应,但是当我指定要传递到 RabbitMQ 的输出 channel 属性,我不再通过配置的 int-amqp:inbound-gateway 接收响应而是收到一个异常,指出“处理程序没有生成回复... AmqpOutboundEndpoint#0”。
以下消息处理程序链配置为传递 ServiceActivator 带注释的方法的返回值 (com.uscs.cdm.Response)到输出 channel “toRabbit”。
即使使用入站/出站 channel 适配器对,当我期待下面的 HttpAmqpClientDemo 响应时,我也会收到 HTTP 500 状态代码。据我了解,当预期来自同一消息流的响应时,我应该使用入站/出站网关对。
我在这里做错了什么?另外,我是否应该使用入站 channel 适配器(下面 gateway-context.xml 中的“fromRabbitReply”)来使用 AMQP 后处理有效负载?
从下面的日志中,我确实看到“com.uscs.cdm.Response”是流程中的有效负载,但我无法用它做任何事情。
我们将非常感谢您的帮助。
EDIT1:删除了不必要的配置,为 channel 使用了更合适的名称,并附加了来自服务器的完整调试堆栈跟踪
http-outbound-config.xml
<int:gateway id="requestGateway2"
service-interface="org.springframework.integration.samples.http.RequestGateway"
default-request-channel="requestChannel2"/>
<int:channel id="requestChannel2"/>
<int:object-to-json-transformer input-channel="requestChannel2" output-channel="outboundGatewayChannel" content-type="application/json" />
<int-http:outbound-gateway request-channel="outboundGatewayChannel"
url="http://localhost:8280/http/receiveGateway2"
http-method="POST"
expected-response-type="com.uscs.cdm.Response"/>
<!-- From RabbitMQ To STDOUT -->
<int-amqp:inbound-channel-adapter channel="fromRabbitReply"
queue-names="si.test.replyQueue" connection-factory="connectionFactory" />
<int:transformer input-channel="fromRabbitReply" output-channel="consoleOut" expression="'Reply received: ' + payload" />
<int-stream:stdout-channel-adapter id="consoleOut"
append-newline="true" />
<!-- Infrastructure -->
<rabbit:connection-factory id="connectionFactory" host="localhost" />
HttpAmqpClientDemo.java
public class HttpAmqpClientDemo {
private static Logger logger = Logger.getLogger(HttpClientDemo.class);
public static void main(String[] args) {
try {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
"/META-INF/spring/integration/http-outbound-config.xml");
RequestGateway requestGateway = context.getBean("requestGateway2", RequestGateway.class);
Request request = new Request(123, "Some value");
Response reply = requestGateway.echo(request);
logger.info("\n\n++++++++++++ Replied with: " + reply.getSomeResponseText() + " ++++++++++++\n");
Thread.sleep(5000);
} catch (BeansException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
网关上下文.xml
<bean id="jackson2JsonObjectMapper" class="org.springframework.integration.support.json.Jackson2JsonObjectMapper" />
<int:channel id="receiveChannel_2A"/>
<int:channel id="receiveChannel_2B"/>
<int-http:inbound-gateway request-channel="receiveChannel_2A"
path="/receiveGateway2"
supported-methods="POST"/>
<int:json-to-object-transformer input-channel="receiveChannel_2A" output-channel="receiveChannel_2B"
type="com.uscs.cdm.Request" object-mapper="jackson2JsonObjectMapper" />
<int:chain input-channel="receiveChannel_2B" output-channel="toRabbit">
<int:header-filter header-names="content-type" />
<int:service-activator ref="requestGateway" />
amqp-context.xml
<int:channel id="toRabbit"/>
<int:channel id="fromRabbitReply" />
<int-amqp:outbound-gateway
request-channel="toRabbit" amqp-template="amqpTemplate"
exchange-name="si.test.exchange"
routing-key="si.test.binding" />
<bean id="myServiceHandler" class="org.springframework.integration.samples.amqp.HandlerService"/>
<int:service-activator input-channel="fromRabbit"
ref="myServiceHandler"
method="handle"/>
<int-amqp:inbound-gateway request-channel="fromRabbit"
queue-names="si.test.queue" connection-factory="connectionFactory" />
<int:channel id="fromRabbit">
<int:interceptors>
<int:wire-tap channel="loggingChannel" />
</int:interceptors>
</int:channel>
<int:transformer input-channel="fromRabbit" output-channel="consoleOut" expression="'Received: ' + payload" />
<int-stream:stdout-channel-adapter id="consoleOut"
append-newline="true" />
<int:logging-channel-adapter id="loggingChannel" log-full-message="true" logger-name="tapInbound"
level="INFO" />
<!-- Infrastructure -->
<rabbit:connection-factory id="connectionFactory" host="localhost" />
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" />
<rabbit:admin connection-factory="connectionFactory" />
<rabbit:queue name="si.test.queue" />
<rabbit:queue name="si.test.replyQueue" />
<rabbit:direct-exchange name="si.test.exchange">
<rabbit:bindings>
<rabbit:binding queue="si.test.queue" key="si.test.binding" />
<rabbit:binding queue="si.test.replyQueue" key="si.test.reply.binding" />
</rabbit:bindings>
</rabbit:direct-exchange>
来自服务器的堆栈跟踪:
13:43:23.774 [qtp692680779-32 - /http/receiveGateway2] DEBUG o.s.i.h.i.HttpRequestHandlingMessagingGateway - failure occurred in gateway sendAndReceive: No reply produced by handler 'org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0', and its 'requiresReply' property is set to true.
13:43:23.774 [qtp692680779-32 - /http/receiveGateway2] DEBUG o.s.w.s.m.a.ResponseStatusExceptionResolver - Resolving exception from handler [org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway#1]: org.springframework.integration.handler.ReplyRequiredException: No reply produced by handler 'org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0', and its 'requiresReply' property is set to true.
13:43:23.774 [qtp692680779-32 - /http/receiveGateway2] DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolving exception from handler [org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway#1]: org.springframework.integration.handler.ReplyRequiredException: No reply produced by handler 'org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0', and its 'requiresReply' property is set to true.
13:43:23.774 [qtp692680779-32 - /http/receiveGateway2] DEBUG o.s.web.servlet.DispatcherServlet - Could not complete request
org.springframework.integration.handler.ReplyRequiredException: No reply produced by handler 'org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0', and its 'requiresReply' property is set to true.
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:147) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:120) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:442) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:392) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:231) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:154) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:233) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:231) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:154) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:102) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:105) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:123) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:231) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:154) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:102) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:105) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:104) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:147) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:120) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:442) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:392) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:231) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:154) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:102) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:105) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:147) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:120) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:442) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSendAndReceive(GenericMessagingTemplate.java:150) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSendAndReceive(GenericMessagingTemplate.java:45) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.messaging.core.AbstractMessagingTemplate.sendAndReceive(AbstractMessagingTemplate.java:42) ~[spring-messaging-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:97) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:422) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:390) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.actualDoHandleRequest(HttpRequestHandlingEndpointSupport.java:509) ~[spring-integration-http-4.2.1.RELEASE.jar:na]
at org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.doHandleRequest(HttpRequestHandlingEndpointSupport.java:404) ~[spring-integration-http-4.2.1.RELEASE.jar:na]
at org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.handleRequest(HttpRequestHandlingMessagingGateway.java:103) ~[spring-integration-http-4.2.1.RELEASE.jar:na]
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51) ~[spring-webmvc-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[spring-webmvc-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) ~[spring-webmvc-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) [spring-webmvc-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar:3.1.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:224) [websocket-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-security-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.Server.handle(Server.java:499) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) [jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) [jetty-io-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [jetty-util-9.2.14.v20151106.jar:9.2.14.v20151106]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [jetty-util-9.2.14.v20151106.jar:9.2.14.v20151106]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_67]
13:43:23.775 [qtp692680779-32 - /http/receiveGateway2] DEBUG o.s.b.c.w.OrderedRequestContextFilter - Cleared thread-bound request context: Request(POST /http/receiveGateway2)@21c7fd13
最佳答案
<int-amqp:outbound-gateway>
等待响应,但是您的 <int-amqp:inbound-gateway request-channel="fromRabbit">
不这样做,只是使用 <int-stream:stdout-channel-adapter>
打印到控制台,所以这是消息流的结束:没有什么可回复的,只是因为没有一个组件这样做。
回复<int-amqp:outbound-gateway>
/<int-amqp:inbound-gateway>
配对您无需担心任何replyQueue
因为这些网关已经使用Temporary Queue
来关心这一点.
从另一边,所有 Spring Integration 请求/回复组件将其结果发送到 replyChannel
来自请求消息 header ,如果您未指定 output(reply)-channel
在组件上。
所以,而不是单向 <int-stream:stdout-channel-adapter>
你应该有一些<service-activator>
,或任何其他双向组件,但没有 output-channel
选项。一切都会正常,因为有 TemporaryReplyChannel
参与其中。
请阅读《Spring 集成引用手册》中的更多内容。
关于spring-integration - Spring Integration 同步/异步消息流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34317497/
我目前是一群学生的团队负责人,他们正在为一门类(class)的项目工作,该类(class)目前由电气和计算机工程专业的学生组成。我是一名电气工程专业的学生,我还没有开始研究该项目的软件组件。我觉得
我们对 spring-integration 非常满意,除非事情没有按预期工作。然后真的很难找出发生了什么(我们使用的是xml配置)。有人可以将我指向 spring 集成组件背后的 java 组件以便
我需要评估几个积分,我正在使用正常 (0,1) 密度来测试。 在 python 中 import scipy.integrate as integrate import scipy.stats imp
我想保留原始请求的原始有效负载并将其放在 xslt-transformer 或其他操作中。我丢失了它,因为我使用了 xslt-transformer,并且我只需要转换中的一些元素。所以我的场景是: 1
我想知道在 Spring Integration 中使消息不可变的原因是什么。 仅仅是因为多线程环境中的线程安全吗? 表现?当您每次要向现有消息添加某些内容时都必须创建新消息时,您不会受到性能惩罚吗?
我有一个偶尔会返回 503 错误的 http 网关调用。我想配置 retry advice围绕那个调用,但我不想为每个错误都这样做,只是 503s。 我已经配
我们正在使用 Spring Integration 4.2.3 聚合器组件和定义的组超时,并期望组在给定的超时值内超时,同时向组添加消息和发布大小标准不满足。 但我们看到了不同的结果,当我们向服务输入
我需要轮询邮件服务器。由于我的项目已经在 Spring 中,我使用 Spring-Integration 来轮询邮件服务器。我在这方面很成功。但现在我必须轮询多封电子邮件。有人可以告诉我该怎么做吗。
现在,我正在从事的项目已经达到了一个复杂的水平,需要完成多个步骤(实际上,它变得不可思议!)才能生产出完整/可用的产品。不幸的是,我们并不是从Continuos Integration的心态开始的,所
哪些指标表明应该使用企业集成模式框架?另一方面,哪些指标表明应该坚持使用简单的旧代码进行逻辑流? 就我而言,我们将 Spring Integration 应用于映射/处理应用程序,该应用程序从数据库读
我们在 XML 中有以下工作配置,并正在尝试转换为 DSL。不确定它们是否等效,也尝试使用 inboundAdapter。但是,我无法弄清楚如何在那里设置与并发相关的值。有人可以建议他们是否在 DSL
所以我在玩这个: factors :: Integral a => a -> [a] factors n = filter (\d -> n `rem` d == 0) . takeWhile (\d
我是 Spring 集成的新手,正在尝试建模一个流程,其中我通过 HTTP 进行同步请求和响应,但也是交付的同一流程的一部分将响应发送到队列,对其进行后处理,并让一个单独的进程使用该响应。所以从调用流
我有一个 Spring Integration Flow 项目,它公开了一个 Rest 网关,在收到 Rest POST 请求后,它会执行一些小逻辑。基于一些有效负载参数,我想动态激活另一个 Spri
我浏览了 Internet,在 Spring 论坛上发帖,并阅读了几乎全部在线文档,但我无法弄清楚 Spring Integration 是否可以在单个多资源 (JTA) 事务中处理多个消息。这对于我
我正在查看 spring-projects/spring-integration-samples 中的聚合器示例。 https://github.com/spring-projects/spring-
我正在查看 spring-projects/spring-integration-samples 中的聚合器示例。 https://github.com/spring-projects/spring-
我有一个 spring-integration接受 org.w3c.dom.Document 并返回域对象的转换器。这很好。如果缺少元素,我会引发应用程序异常。 但是,我想将该异常放到错误 chann
我显然已经通读了 documentation , 但我无法找到更详细的幕后情况描述。具体来说,有几个行为我很疑惑: 一般设置 import numpy as np from scipy.integra
我正在使用 Spring Integration 使用以下配置从目录中读取文件。但是,我希望在找到任何文件后停止轮询,直到服务不再重新启动为止。有什么方法可以在运行时更改轮询器延迟或在运行时启动/停止
我是一名优秀的程序员,十分优秀!