I have google about spring support of servlet 3.0/3.1 specification and most of information I have found at this article: Understanding Callable and Spring DeferredResult
Here author say that you can return Callable
or DefferedResult
from controller and say it is servlet 3.0/3.1 maintain in spring.
But I don't understand how to apply it in my situation:
I have external system and I get result from this system asynchrounously.
In controller I write something like this:
externalSystenm.send(requestId, message);
and I have another thread where I get result:
Message m = externalSystem.get();
m.getRequestId();// According this id I can map message to request
I know that in servlet API I allow to save asyncContext in map and then found it.
How can I acheve it in spring ?