Announcement Announcement Module
Collapse
No announcement yet.
Question - retain request payload after response arrive for a synchronous call Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question - retain request payload after response arrive for a synchronous call

    Hello,

    Does SI support retaining request payload after the synchronous call completes to some service.

    example

    <int:channel id="inChannel"/> >>>> contains payload for request -------(1)

    <int-ws:outbound-gateway request-channel="inChannel"
    reply-channel="outChannel"
    uri="http://someservice" />

    <int:channel id="outChannel"/> >>>> contains payload for response (2)

    how can access the request payload after point (2) reached ?

    Thanks

  • #2
    Use header enricher before <int-ws:outbound-gateway..> and copy original payload as a header value.
    Code:
    <int:channel id="inChannel"/> >>>> contains payload for request -------(1)
    
    <int:header-enricher input-channel="inChannel" output-channel="wsChannel">
         <int:header name="originalPayload" expression="payload"/>
    </int:header-enricher>
    
    <int-ws:outbound-gateway request-channel="wsChannel" 
    reply-channel="outChannel" 
    uri="http://someservice" />
    
    <int:channel id="outChannel"/> >>>> contains payload for response (2)

    Comment


    • #3
      Hello

      Use header enricher
      Or you can use <aggregator> before outChannel and inChannel should be used with last one inside <recepient-list-router>.

      Comment


      • #4
        Thanks Artem!
        Yeah, aggregator is actually a better and cleaner version than header-enricher, since the original payload does not have to be duplicated.

        Comment


        • #5
          Thanks Artem!
          Yeah, aggregator is actually a better and cleaner way than header-enricher, since the original payload does not have to be duplicated.

          Comment


          • #6
            Just to throw one more option on the table... depends on the details of your use-case, but if you are trying to have that same request payload as the reply but *enrich* it with information you get back from the Web Service call, then you should look at the new (2.1) Enricher support: http://static.springsource.org/sprin...ntent-enricher

            Specifically, read through section 6.2.3 "Payload Enricher".

            Comment

            Working...
            X