spring - DeferredResult Empty Body -
i've seen this, having issue now.
if change controller return responseentity<?>
body comes through fine, if returns deferredresult<responseentity<?>>
headers , status code no response body.
any appreciated
use of deferredresult
not matter of changing controller's response type. controller returns deferredresult
delegate handling of request thread pool (or async mechanism) , whatever performs request must set response on deferredresult
. this:
in controller:
deferredresult deferredresult = new deferredresult<>(); // pass deferredresult runnable task (or similar) // scheduled execution via thread pool (or similar) return deferredresult;
in task executes request on behalf of controller:
// work // ... deferredresult.setresponse(responsebody);
Comments
Post a Comment