3
votes

I am new to spring integration and am trying to model a flow in which I have a synchronous request and response via HTTP, but also part of the same flow that delivers the response to queue, post-processes it, and has a separate process consume that response. So it is synchronous from the perspective of the client invoking the flow; Asynchronous from within the flow at the point where the response is placed on a queue. I am hosting the gateway-context.xml and amqp-context.xml within an embedded Jetty server and posting from a separate process via HttpAmqpClientDemo below.

I am able to submit the request and receive the response, but when I specify the output-channel attribute to deliver to RabbitMQ, I no longer receive a response via the configured int-amqp:inbound-gateway and instead receive an exception stating the there is 'No reply produced by handler ... AmqpOutboundEndpoint#0'.

The following message handler chain is configured to deliver the return value (com.uscs.cdm.Response) of the ServiceActivator annotated method to the output-channel "toRabbit".

Even when using the inbound/outbound-channel-adapter pair I receive a HTTP 500 status code when expecting the response from HttpAmqpClientDemo below. It is my understanding that I should be using the inbound/outbound-gateway pair instead when expected a response from the same message flow.

What am I doing wrong here? Also, should I be using a inbound-channel-adapter ("fromRabbitReply" in gateway-context.xml below) to consume the AMQP post-processed payload?

From the logs below, I do see that 'com.uscs.cdm.Response' is a payload within the flow, but I am having trouble doing anything with it.

Your help would be greatly appreciated.

EDIT1: Removed unnecessary configuration, used more appropriate names for channels and appended full debug stack traces from server

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();
            }
        }

    }

gateway-context.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>

Stack trace from server:

        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
1
There's so much configuration there; it's not clear exactly where you are having difficulty; a full stack trace together with a DEBUG log will help. Your question about the inbound channel adapter is unclear - all it does is route to stdout. Your channel names are confusing outboundRequestAmqpChannel has nothing to do with AMQP; it's an HTTP outbound gateway.Gary Russell
<int-amqp:outbound-gateway> waits for the response, but your <int-amqp:inbound-gateway request-channel="fromRabbit"> doesn't do that and just prints to the console using <int-stream:stdout-channel-adapter>, so it is the end of the message flow: nothing to reply just because no one component do that.Artem Bilan
Thank you all for your responses. I cleaned the content as best I could. I have included the stacktrace from the server. @Artem Should I be posting back to another component instead of having the flow end at the '<int-stream:stdout-channel-adapter>'? Not sure how that gets configured. What I want to do is return the response and place the response on a queue (e.g. 'si.test.replyQueue') then consume the response from that queue. I can remove the stdout logging entirely, but not sure what to use at that point in the flow. I was only using it to better see what is happening in the flow.Rai

1 Answers

0
votes

The <int-amqp:outbound-gateway> waits for the response, but your <int-amqp:inbound-gateway request-channel="fromRabbit"> doesn't do that and just prints to the console using <int-stream:stdout-channel-adapter>, so it is the end of the message flow: nothing to reply just because no one component do that.

To make a reply for the <int-amqp:outbound-gateway>/<int-amqp:inbound-gateway> pair you don't need to worry about any replyQueue because those gateways take care about that already using Temporary Queue.

From other side all Spring Integration request/reply components sends it result to the replyChannel from request Message header, if you don't specify output(reply)-channel on the component.

So, instead of one-way <int-stream:stdout-channel-adapter> you should have some <service-activator>, or any other two-way component, but without that output-channel option. Everything will work because there is a TemporaryReplyChannel involved.

Please, read more in the Spring Integration Reference Manual.