Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3026

Document header enrichment using a gateway

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.2.3
    • Fix Version/s: 3.0 M2, 2.2.4
    • Component/s: Documentation
    • Labels:
    • Environment:
      N/A

      Description

      As per VMware Support Request 13319275205, I had requested a way to enricher headers in a similar way that you can use the <enricher> to enrich payloads. The solution in combination with a jdbc:outbound-gateway was outlined as follows:

      <int:header-enricher input-channel="publishingChannel" output-channel="outputConsole">
      	<int:header name="status" expression="@statusFlow.exchange(#root).payload['STATUS']" />
      </int:header-enricher>
      		 		 
      <int:gateway id="statusFlow" default-request-channel="getStatusForDeal" />
      		 		 
      <int:chain input-channel="getStatusForDeal">
      	<int:transformer expression="payload.dealId" />
      	<jdbc:outbound-gateway query="select status from trade_details where dealId = :payload"
      		data-source="dataSource" />
      </int:chain>
      

      This solution isn't immediately obvious so I was wondering whether this could be documented in some way (the Github Wiki has been requested) or ideally we can one day see a header enricher based on the payload enricher.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              grussell Gary Russell
              Reporter:
              philip.grivell Philip Grivell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: