-1

I'm new to Hystrix. I have a list of dependency calls which I need to wrap using HystrixCommand. Only possible way I found is by creating separate HystricCommand subclass for each dependency call & invoke the dependency within the run method of the specific hystrix class. This leads to creation of say 10 HystrixCommand subclass if I need to wrap 10 of my dependency calls, 1 class for each dependency call.

Is there a way where I can create a common HystrixCommand subclass for all the 10 dependency calls from where I can invoke the dependencies?

Manikandan
  • 83
  • 1
  • 7

1 Answers1

1

The purpose of the Hystrix command is to isolate failures in one dependency call from another and so by creating one single HystrixCommand object you are potentially negating the purpose of the command objects. Also, each dependency would typically have different requirements in terms of fallbacks and settings, so you would probably be best to create separate command objects for each dependency.