Aggregate server response #11828
-
Using Spring cloud gateway 2020.0.3 (uses Netty 4.1.67 internally) I would like to log HTTP headers and body (possibly chunked) to single line. To be able to log it I first need it to log at least in one log message. Request is logged in single log message (multiline) on its own, nothing special is needed. Server response on the other hand is logged in multiple log events headers first, some other lines and body in second log event. Netty reactor team directed me to HttpObjectAggregator which seems to be exactly what I need. But it is called only on requests not responses. Since I don't know how to link Netty reactor Gitter thread allow me to copy&paste my question from there: According to the documentation handlers in pipeline are called on inbound/outbound based on the fact if handler implements interface: ChannelInboundHandler or ChannelOutboundHandler. If so, adding HttpObjectAggregator won't work with response (despite the fact that its coode looks like it would do something also with responses) because its hierarchy is: HttpObjectAggregator -> MessageAggregator -> MessageToMessageDecoder -> ChannelInboundHandlerAdapter -> ChannelHandlerAdapter, ChannelInboundHandler -> ChannelHandler There is no outbound interface there. What has to be done to use HttpObjectAggregator also for server response? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Actually it works for responses and requests. |
Beta Was this translation helpful? Give feedback.
Actually it works for responses and requests.