简体   繁体   中英

Netty 4.1: preventing TCP ACK from being sent on server exception

I'm working with an existing Java server that uses Netty 4.1 to receive a proprietary protocol. Occasionally, the downstream system to which these messages must be passed will not be able to accept them. When this occurs, an exception will be thrown in my pipeline. Under these circumstances, rather than implement my own recovery mechanism, I'd prefer to take advantage of the fact that the (existing) client will resend messages for which TCP ACK is not received.

Is such a scheme possible with netty, and if so, how should I implement my pipeline to achieve this? All the ChannelHandler implementations in my pipeline run in the parent group, as their operation is acceptably fast.

TCP ACK is a transport layer mechanism to acknowledge that the data was successfully received at the recipient. What you want in your use case is an application layer mechanism to acknowledge that the data were successfully processed by the application (which includes forwarding it to another step in the pipeline).

These are completely different things, ie success of data delivery vs. data processing. There is no API to (mis)use the first for the latter, ie you need to implement your own (application level) mechanism.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM