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

Adding support for nested <header> sub-elements (e.g., bean, script etc.) when configuring the <header-enricher>

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0.4
    • Component/s: Core
    • Labels:
      None

      Description

      Add support for calculating the header value from Groovy (or others?) script like SpEL.
      Sample:

       <header-enricher>
                  <header name="logId" ref="logRequestResponseAction" method="log"/>
                  <header name="TEST_HEADER">
                      <groovy:script>
                          <![CDATA[
                                  new XmlParser().parseText(headers.requestXml).with {
                                      return new Date(Date.parse("yyyy-MM-dd'T'HH:mm:ss", headerData.messageDescription.requestDate.text()).time + 300 * 1000)
                                  }
                                  ]]>
                      </groovy:script>
                  </header>
              </header-enricher>
      

      I do not think it should be full support for nested beans, as shown by Oleg, because in this case the header value will be calculated only once - when the application is starting.
      And it will look like StaticHeaderValueMessageProcessor strategy.
      In other words, it would be redundant.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                oleg.zhurakousky@springsource.com Oleg Zhurakousky
                Reporter:
                abilan Artem Bilan
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: