Saturday, October 27, 2012

Spring Integration, Content-Length and WebSphere

Spring Integration, Content-Length and WebSphere

one little annoying thing i discovered the other day was that WebSphere (either app server or the http server) truncates the outbound response to the content-length value.  so, if you're content-length value is less than your content, you'll get a truncated body content.  nice...

this becomes a little bit of a problem when using Spring Integration 2.1.x out of the box.  if you're using the http-inbound-gateway, and you don't set which request headers to map, it will map all of them, including content-length.  This header then stays on the message (unless manipulated later) and is passed out, with the value set by the original request.  

the fix for this is straight-forward, set the mapped-request-headers value.  that way, only the specific header names will be set.  otherwise, you can enrich the headers on the way out, but that becomes a little more tricky when specifying the content length.

No comments:

Post a Comment