I have been considering Netflix OSS circuit breaker solution - Hystrix.
Everything sounds good but I think that having the command run in a different thread does not make sense in my use case scenario.
That is because the work done by my request handler requires very little computation before calling the remote service. Also, there is nothing I can do while waiting for the response.
Example in Pseudo code:
@post("/token") token(@body authResult){ Validate authResult Get id from authResult Call a remote service to get authz token Return authz token }
I would like to do the remote call using hystrix but I do not think it makes sense to execute the command in a separate thread since I would be blocked anyway.
Any suggestions? Is it possible to run hystrix command in the same thread as the caller?