From Javadocs:
Hystrixcommand
This command is essentially a blocking command, but provides an observable facade if used with the observation function ()
HystrixObservableCommand
This command should be used for a purely non-blocking call pattern. The caller of this command will be subscribed to the Observable returned by the run () method.
The difference is that the HystrixCommand supports the blocking paradigm by default, but also provides non-blocking behavior through Observables through the faรงade, while the HystrixObservableCommand is implemented specifically for a non-blocking installation. I'm not quite sure why it split into two implementations, but I would suggest that the reason is that initially HystrixCommand did not support non-blocking. This was added about a year or so after the initial implementation . Maybe it was just cleaner to write a purely non-blocking class.
If you only work with non-blocking calls, most likely you should use the HystrixObservableCommand. Ben Christensen, one of the developers of Hystrix, perfectly sums up this post:
However, if you block call blocking, you should just stick with the use of HystrixCommand, as the one built for it by default starts everything in a separate thread. Using HystrixCommand.observe () will give you the simultaneous, asynchronous that you are looking for.
HystrixObservableCommand is designed to bypass asynchronous, non-blocking Observables that do not need additional threads.
source share