There is below main Spring Integration flow that receives the request through HTTP, handle it using several subflows and then replies to the consumer. The problem is that when the flow enters the first subflow, it loses practically all its headers including reply channel.
I want to know to what point the headers from the request should reach? to the end of the flow(RESPONSE_CHANNEL)? And how to avoid losing headers after entering subflow?
@Bean
public IntegrationFlow exampleFlow() {
return IntegrationFlows.from(
Http.inboundGateway("/conversions/lower")
.requestMapping(r -> r.methods(HttpMethod.POST)
.mappedRequestHeaders("*")
.requestPayloadType(Foo.class)
.replyChannel(RESPONSE_CHANNEL)
.mappedResponseHeaders("*")
)
.transform(this:transforFoo)
.channel(CHANNEL1)
.handle(fooFlowConfiguration.flowHandler())
//several handlers in another subflow
.channel(RESPONSE_CHANNEL)
.get();
}
I tried to enrich headers before the end of the flow, but it does not help And tried to add .mappedResponseHeaders("*")