Spring Integration - Header Routing by Header Key

by GarciaPL on Sunday 8 January 2017

As you can see Spring Integration posts are going to be continued! This time I would like to share with you small hint of code which will help you to route your message based on existing or not key Signature in your headers.

<int:router id="headerRouter" expression="headers.containsKey('Signature')"
            default-output-channel="processFurther">
    <int:mapping value="false" channel="drop"/>
    <int:mapping value="true" channel="processFurther"/>
</int:router>

References :  [1] Spring Docs - Message Routing