Client (haproxy) - Server (app). Closing incoming traffic from client to application without breaking connections

Hello. There is such a problem. Client (haproxy has tcp mode), application (java). When the application stops, we get errors on the application, since the application did not have time to respond to the requests that came to it. Is there a way to stop incoming requests from haproxy, while not hard breaking a session, so that the application has time to respond to requests that have come to it, and only then break sessions.