The pseudocode of my flow is
@Bean
private IntegrationFlow myChannel() {
return f -> f
.enrichHeaders(h -> h.header("x", "y", true))
.split(...)
...
..handle("myHandler", "doMyWork")
...
.enrichHeaders(h -> h.header("x", "z", true))
}
First the header "x" is set to the value "y". Then messages are split and for the first message the header is set to the value "z". When the second message comes to the method doMyWork of the handler myHandler the header "x" has value "y". I want that value to be "z".
So how to share the header value inside one integration flow run? I want that value is shared only inside one specific integration flow, because there can be multiple flows running same time.