Checking the headers HttpRequestExecutingMessageHandler i notice a common header, accept-encoding, gzip which throws an Exception on response during the convertion phase, i.e. the message could not be converted throwing an error on response. Which is my guess related to the undelaying HttpClient used.
Is there any reason to put this header on the RestTemplate by default? Removing the header with the header filter the Rest request ran normally.
Also i tried to use a RestTemplate - but the header remains there, so just the header filter worked.
But when testing internally (using the HTTP Rest to connect distinct Integration instances) things worked normally, i.e. the header message is handled normally(and i don't know the reason since the out. problem occurred with outbound RestServers.
The flow as example is bellow.
Regards,
**
IntegrationFlows.from("theRequestChannel")
.transform(Transformers.fromJson(MyClass.class))
.enrichHeaders(m -> m.header("app_id", "appid"))
.enrichHeaders(m -> m.header("app_key", "app_key"))
.headerFilter("accept-encoding")
.handle(myHandler())
.get();
**