Results 1 to 8 of 8

Thread: concurrency problem using direct channel with http inbound gateway

  1. #1

    Default 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

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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.

  3. #3

    Default

    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.

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    store in request scope
    - 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.

  5. #5

    Default

    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

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    What version of Spring Integration you are using?

  7. #7

    Default

    1.0.3.release

  8. #8
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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
  •