How to change the response of rest contolloer during runtime

3/5/2019

I need to achieve something similar to Executor.shutdown() vs Executor.shutdownNow() in the context of rest service (reactive in this case). I tried health status outOfService and down while carrying out graceful shutdown, but application still send response to new incoming request, during the given duration of thread sleep. I have gone through most of google result for graceful shutdown but none of them discuss how to block incoming requests while still sending correct response for the requests already fired. Some of the ideas discussed are deregistring controller (dont know if thats even possible), using filters or sending a new response object based on some condition. Does anyone know how to achieve this ?

-- Sameer Sinha
java
kubernetes
reactive
rest
shutdown-hook

0 Answers