opossum icon indicating copy to clipboard operation
opossum copied to clipboard

How can I get single CB for whole HTTP Client with Opossum?

Open murbanowicz opened this issue 1 year ago • 4 comments

Hi, I really like this project and I appreciate your work on it.

I am missing one thing - how to use single breaker for a e.g. whole HTTP Client for given dependency. Having separate on each method does make much sense in such scenario and having single CB for the single dependency like this makes much more sense.

Is there any way to get it working like that with Opossum?

murbanowicz avatar Nov 29 '23 07:11 murbanowicz

do you have a small code(even pseduo code would work) example of what you are looking for?

lholmquist avatar Nov 29 '23 14:11 lholmquist

E.g.

export class MyHttpClient {
  getOrders() {
     this.circuitBreaker....(???) // call get /orders on target service
  }
  
    getPayments() {
     this.circuitBreaker....(???) // call get /payments on target service
  }
}

both should use same CB as they are targeting the very same service.

murbanowicz avatar Nov 30 '23 06:11 murbanowicz

If you are using a class, could you just setup the circuit breaker in the constructor and then this.circuitBreaker should reference that single instance?

lholmquist avatar Nov 30 '23 16:11 lholmquist

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Dec 31 '23 00:12 github-actions[bot]

closing since we didn't get a response from the previous suggestion

lholmquist avatar Mar 21 '24 17:03 lholmquist