-
Aug 17th, 2011, 03:15 AM
#1
concurrency problem using direct channel with http inbound gateway
Hi
Can anyone please explain the difference between direct channel and threadscopechannel?
Trying to use direct channel for a HTTP inboud gateway with further processing and integrating to JMS outbound gateway and expecting a response back for the same HTTP request.
Thanks
Pranshu
-
Aug 17th, 2011, 08:39 AM
#2
Well, you don't need 'threadscopechannel' to accomplish what you describe since HTTP gateway will create a temporary and dedicated reply channel that will be carried with the Message headers.
-
Aug 21st, 2011, 01:03 AM
#3
Thanks for your response.
I have a httpinboundgateway > service activator to get the details from the message and store in request scope > splitter(transforms internally while splitting) > service activator to send the message off to jmsoutboundgateway > service activator gets the response from JMS and do nessacary validation> service activator sends the message back to httpinboundgateway resply channel(transforms internally).
The problem is JMS implementation (third party) never send back the message header what are set by my application. I might be completely wrong but I am thinking it is getting lost and for some other odd case threads are picking up different message which they are not entitled to.
Please help.
-
Aug 21st, 2011, 01:46 PM
#4
- I am a bit puzzled by that. Could you please show your configuration? The thing is that SI Messaging flows are stateless. That's why Gateways are employing different request/reply correlation mechanism (temporary reply channels passed via Message Header), so I am not sure what role is played by the 'request' scope.
-
Aug 23rd, 2011, 09:07 AM
#5
Thanks.
I have uploaded the configuration file:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:si="http://www.springframework.org/schema/integration"
xmlns:http="http://www.springframework.org/schema/integration/http"
xmlns:file="http://www.springframework.org/schema/integration/file"
xmlns:jms="http://www.springframework.org/schema/integration/jms"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schem...ring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schem...ration-1.0.xsd
http://www.springframework.org/schema/integration/file
http://www.springframework.org/schem...n-file-1.0.xsd
http://www.springframework.org/schema/integration/http
http://www.springframework.org/schem...n-http-1.0.xsd
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schem...on-jms-1.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:annotation-config/>
<si:channel id="httpChannel" />
<si:channel id="enrichedHeaderHttpChannel" />
<si:channel id="splitResponseChannel" />
<si:channel id="stbResponseChannel" />
<si:channel id="mcsResponseChannel" />
<si:channel id="stbEnrichedResponseChannel" />
<si:channel id="stbAggregatedResponseChannel" />
<si:channel id="httpResponseChannel" />
<si:channel id="stbErrorChannel" />
<si:splitter id="stbRequestSplitter" ref="stbCustomSplitter"
method="splitMessage" input-channel="enrichedHeaderHttpChannel"
output-channel="splitResponseChannel" />
<http:inbound-gateway id="STBInboundGateway"
request-channel="httpChannel" reply-channel="stbResponseChannel" name="/mainURL/*"
supported-methods="POST,GET" request-mapper="STBInboundMapper"
reply-key="stbResponse" reply-timeout="70000" />
<bean id="mcsResponseAggregator"
class="com.abc.mainprj.gateway.integration.aggrega tor.MCSResponseAggregator"
scope="request" />
<si:service-activator input-channel="stbEnrichedResponseChannel"
output-channel="stbResponseChannel" method="handleAggregatedResponse"
ref="stbAggregatedReponseHandler" />
<si:service-activator input-channel="httpChannel"
output-channel="enrichedHeaderHttpChannel" method="handleSTBRequest"
ref="stbHandler" />
<si:service-activator input-channel="splitResponseChannel"
method="handleSplitSTBRequestMessage" ref="stbSplitRequestActivator" />
<si:service-activator input-channel="mcsResponseChannel"
method="handleMCSResponse" ref="stbReponseHandler" output-channel="stbEnrichedResponseChannel" />
<bean id="connectionFactory"
class="com.abc.mainprj.gateway.helper.CustumMQQueu eConnectionFactory"
init-method="setup" scope="prototype">
<property name="transportType" ref="transportType" />
<property name="env" value="mq" />
<property name="filename" value="classpath:Queue.properties" />
<property name="useConnectionPooling" value="true" />
</bean>
..........
I uses request scope bean to have the elements of the xml which can be used later, as MESSAGE_HEADERS is deleted by third party JMS.
Thanks,
Pranshu
-
Aug 23rd, 2011, 09:12 AM
#6
What version of Spring Integration you are using?
-
Aug 23rd, 2011, 09:26 AM
#7
-
Aug 23rd, 2011, 09:34 AM
#8
wow!, This is pretty much and EOL version. Can you upgrade to 2.0.5 (the latest release).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules