timeout issues in spring integration gateway for soap request and reply -
timeout issues in spring integration gateway for soap request and reply -
i facing chellenge while setting timeout soap request esb interface interface(using spring integration). while sending request esb interface, setting request timeout = 5000ms , reply timeout = 5000ms in case services downwards on esb interface, request not timeout in desired timeout time of 5000ms(5 sec) , timeout in 40sec or more. tried utilize default request timeout , default reply timeout options int:gateway configuration same issue. please see below configuration done:
<int:gateway id="soapesbgateway" service-interface="test.soap.service.servicesoap"> <int:method name="serviceresponse" request-channel="requestchannel" reply-channel="replychannel" request-timeout="5000" reply-timeout="5000" /> </int:gateway> <int:chain input-channel="requestchannel" output-channel="replychannel"> <int-xml:marshalling-transformer marshaller="marshaller" result-transformer="resulttransformer"></int-xml:marshalling-transformer> <int:transformer ref="transformerbean" method="transformmethod"></int:transformer> <int-ws:outbound-gateway id="ws-soapesb-gateway" ignore-empty-responses="true" uri="${soap.uri}"></int-ws:outbound-gateway> <int:transformer ref="transformerbean" method="transformmethod"></int:transformer> <int-xml:unmarshalling-transformer unmarshaller="marshaller"></int-xml:unmarshalling-transformer> </int:chain> <bean id="resulttransformer" class="org.springframework.integration.xml.transformer.resulttostringtransformer" /> <bean id="transformerbean" class="test.transformerimpl"></bean>
please allow me know if missing while setting timeout option.
thanks, vinay a
updated:
<int:gateway id="soapesbgateway" service-interface="test.soap.service.servicesoap"> <int:method name="serviceresponse" request-channel="requestchannel" reply-timeout="5000" /> </int:gateway> <int:chain input-channel="requestchannel"> <int-xml:marshalling-transformer marshaller="marshaller" result-transformer="resulttransformer"></int-xml:marshalling-transformer> <int:transformer ref="transformerbean" method="transformmethod"></int:transformer> <int-ws:outbound-gateway id="ws-soapesb-gateway" ignore-empty-responses="true" uri="${soap.uri}" message-sender="messagesender"></int-ws:outbound-gateway> <int:transformer ref="transformerbean" method="transformmethod"></int:transformer> <int-xml:unmarshalling-transformer unmarshaller="marshaller"></int-xml:unmarshalling-transformer> </int:chain> <bean id="resulttransformer" class="org.springframework.integration.xml.transformer.resulttostringtransformer" /> <bean id="transformerbean" class="test.transformerimpl"></bean> <bean id ="messagesender" class="org.springframework.ws.transport.http.httpcomponentsmessagesender"> <property name="connectiontimeout" value="2000"></property> </bean>
as above, have added messagesender bean reference int-ws:outbound-gateway , set property connectiontimeout = 2sec can still see waiting around 19sec first nail when network downwards , next hits, less 19 sec not desired timeout first nail @ least. not have alternative may ascertain desired timeout work always.
thanks, vinay
first of all, please, read chapter: http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/messaging-endpoints-chapter.html#d4e4197
according config have direct
flow, there no reason have request-timeout
, reply-channel
.
the issue of 40sec
under ws gateway's webservicemessagesender
. in case httpurlconnectionmessagesender
default. , there connecttimeout
attribute in httpurlconnection
.
i'm not sure how can alter it, prefer utilize httpcomponentsmessagesender
have more command on http connections.
now question why 40sec, not 5sec reply-timeout?
. because thread blocked on send
, hasn't reached wait reply
part yet.
spring-integration
Comments
Post a Comment