Announcement Announcement Module
Collapse
No announcement yet.
Spring Integration Http Inbound Gateway, threading question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Integration Http Inbound Gateway, threading question

    Hi,
    I am very new to Integration and am trying to create a Rest service based on the Http Inbound gateway, ran into a very strange problem.
    The application runs fine at low threads being thrown at it (1-2 hits) but when I ramp up the load start to get 404 errors on the client. Do I have appropriate number of thread pools or have I misconfigured something?

    Client Side Code:
    <int:gateway id="requestGateway"
    service-interface="com.test.gateway.ServiceRequest"
    default-request-channel="requestChannel"/>

    <int:channel id="requestChannel"/>

    <int-http:outbound-gateway request-channel="requestChannel"
    url="http://localhost/myService/receiveGateway"
    http-method="POST"
    expected-response-type="java.lang.String"/>
    Server Side:
    <int-http:inbound-gateway name="/receiveGateway" reply-channel="httpRespondChannel"
    supported-methods="POST" request-channel="receiverChannel"/>

    <int:channel id="httpRespondChannel"></int:channel>
    <int:channel id="receiverChannel"></int:channel>

    <int:channel id="simpleContentChannel"></int:channel>
    <int:service-activator id="ContentProducer" input-channel="simpleContentChannel">
    </int:service-activator>

    <int:service-activator id="CatalogService" input-channel="responseProcessingChannel" output-channel="evaluteResponseChannel"/>

    <int:channel id="transferToFinalService"></int:channel>
    <int:service-activator id=""
    input-channel="transferToFinalService"
    output-channel="finalServiceReceiptChannel">
    </int:service-activator>


    <int-xml:xpath-router input-channel="receiverChannel"
    resolution-required="true" >
    <int-xml:xpath-expression expression="/Request/Evaluate"/>
    <int-xml:mapping value="Content" channel="responseProcessingChannel"/>
    <int-xml:mapping value="Init" channel="simpleContentChannel"/>
    </int-xml:xpath-router>

    <int:channel id="responseProcessingChannel"></int:channel>


    <int-xml:xpath-router input-channel="evaluteResponseChannel" resolution-required="true">
    <int-xml:xpath-expression expression="/Request/simpleContentReturn"/>
    <int-xml:mapping value="true" channel="simpleContentChannel"/>
    <int-xml:mapping value="false" channel="transferToFinalService"/>
    </int-xml:xpath-router>
    <int:channel id="evaluteResponseChannel"></int:channel>

    <int-xml:xpath-router input-channel="finalServiceReceiptChannel">
    <int-xml:xpath-expression expression="/Request/simpleContentReturn"/>
    <int-xml:mapping value="true" channel="simpleContentChannel"/>
    <int-xml:mapping value="false" channel="simpleContentChannel"/>
    </int-xml:xpath-router>
    <int:channel id="finalServiceReceiptChannel"></int:channel>


    Exception:
    2013-04-11 16:06:22,026 WARN [RestTemplate] POST request for "http://localhost/myService/receiveGateway" resulted in 404 (Not Found); invoking error handler
    2013-04-11 16:06:22,027 WARN [GatewayProxyFactoryBean$MethodInvocationGateway] failure occurred in gateway sendAndReceive
    org.springframework.integration.MessageHandlingExc eption: HTTP request execution failed for URI [http://localhost/myService/receiveGateway]
    at org.springframework.integration.http.outbound.Http RequestExecutingMessageHandler.handleRequestMessag e(HttpRequestExecutingMessageHandler.java:377)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:134)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:73)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :115)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:1 02)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:77)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:128)
    at org.springframework.integration.core.MessagingTemp late.doSend(MessagingTemplate.java:288)
    at org.springframework.integration.core.MessagingTemp late.doSendAndReceive(MessagingTemplate.java:318)
    at org.springframework.integration.core.MessagingTemp late.sendAndReceive(MessagingTemplate.java:239)
    at org.springframework.integration.core.MessagingTemp late.convertSendAndReceive(MessagingTemplate.java: 274)
    at org.springframework.integration.gateway.MessagingG atewaySupport.doSendAndReceive(MessagingGatewaySup port.java:224)
    at org.springframework.integration.gateway.MessagingG atewaySupport.sendAndReceive(MessagingGatewaySuppo rt.java:203)
    at org.springframework.integration.gateway.GatewayPro xyFactoryBean.invokeGatewayMethod(GatewayProxyFact oryBean.java:306)
    at org.springframework.integration.gateway.GatewayPro xyFactoryBean.doInvoke(GatewayProxyFactoryBean.jav a:269)
    at org.springframework.integration.gateway.GatewayPro xyFactoryBean.invoke(GatewayProxyFactoryBean.java: 260)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy19.authenticate(Unknown Source)
    ...........
    at sun.reflect.GeneratedMethodAccessor43.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.web.bind.annotation.support.Ha ndlerMethodInvoker.invokeHandlerMethod(HandlerMeth odInvoker.java:176)
    at org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.invokeHandlerMethod(An notationMethodHandlerAdapter.java:426)
    at org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.handle(AnnotationMetho dHandlerAdapter.java:414)
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:790)
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:560)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:98)
    at org.apache.catalina.valves.StuckThreadDetectionVal ve.invoke(StuckThreadDetectionValve.java:193)
    at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1001)
    at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: org.springframework.web.client.HttpClientErrorExce ption: 404 Not Found
    at org.springframework.web.client.DefaultResponseErro rHandler.handleError(DefaultResponseErrorHandler.j ava:75)
    at org.springframework.web.client.RestTemplate.handle ResponseError(RestTemplate.java:486)
    at org.springframework.web.client.RestTemplate.doExec ute(RestTemplate.java:443)
    at org.springframework.web.client.RestTemplate.execut e(RestTemplate.java:409)
    at org.springframework.web.client.RestTemplate.exchan ge(RestTemplate.java:384)
    at org.springframework.integration.http.outbound.Http RequestExecutingMessageHandler.handleRequestMessag e(HttpRequestExecutingMessageHandler.java:351)
    ... 50 more

    Thanks!
    Regards
    Mrinal
Working...
X