Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Hystrix with Spring Data Repositories

Given that one of the main benefits of Spring Data and the related REST repositories is that most of the time the developer doesn't have to worry about the underlying implementations, is there an out-of-the-box way to leverage the Spring Cloud Netflix libraries, specifically the Hystrix annotations in this case, without extending every call in the provided Repository interfaces or creating my own implementation?

like image 353
bvulaj Avatar asked Oct 19 '22 18:10

bvulaj


1 Answers

Currently you need to wrap calls in another service whose methods are annotated with @HystrixCommand. Because of the way both Spring Data and the Hystrix Aspect work (they both create proxies), there would need to be specific integration in Spring Data for @HystrixCammand. @ccit-spence is right, you really want to put @HystrixCommand on the services calling into a Spring Data REST repository.

like image 75
spencergibb Avatar answered Oct 23 '22 00:10

spencergibb