Announcement Announcement Module
No announcement yet.
Is there any header-transformer in Spring Integration? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there any header-transformer in Spring Integration?

    a transformer may be used to add, remove, or modify the Message's header values
    Said in Spring Integration documentation.
    I find header-enricher, header-filter namespace support for add and remove but no header-transfer for modification.

    The oddest behavior of header-enricher is that it doesn't allow to change an existent header.

    What is suitable solution except definition of a transformer class with a method that have Message return type?

  • #2
    BTW header-enricher has an "overwrite" (and a corresponding property in HeaderEnricher class) but when I use it, see below exception:

    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'overwrite' is not allowed to appear in element 'integration:header-enricher'.


    • #3
      The "overwrite" attribute is available on individual <header> sub-elements of the header-enricher. On the <header-enricher> element itself, you can set the "default-overwrite" which is FALSE by default. If you simply want all headers to replace any existing ones, then set "default-overwrite" to "true".