2

I have an application listening to different sources of events. For each of this events, I build an IntegrationFlow, where I just pipeline operations like filter and transform, and finally send this message to another API, via an HTTP request.

All of this events comes with custom headers that I would like to propagate too.

I managed to propagate them by configuring the DefaultHttpHeaderMapper (that it's already propagating standard http headers like "Accept" or "Content-Type"), but the problem is that I need to do this to every IntegrationFlow.

Consider this example:

    @Bean
    public IntegrationFlow eventFlow(){
        return IntegrationFlows.from(SINK)
            .filter("headers['type'] == 'POST'")
            .transform(Transformers.fromJson(Event.class))
            .handle(
                Http.outboundGateway(uri)
                    .httpMethod(HttpMethod.POST)
                    .mappedRequestHeaders("custom-header-prefix*"))
            .channel("nullChannel")
            .get();
    }

Is there any way to configure this DefaultHttpHeaderMapper, but globally?

0 Answers0