Chandan Agarwal
Chandan Agarwal

Reputation: 466

hystrix @EnableCircuitBreaker in a non spring boot application

I have a simple spring project based on application context xml files (non spring boot). How do I use EnableCircuitBreaker for my client in order to use the hystrix command for fallback in my RestTemplate.

Upvotes: 3

Views: 7084

Answers (2)

pvpkiran
pvpkiran

Reputation: 27078

@EnableCircuitBreaker  

is part of Spring cloud project. which looks for certain classes/methods for some Annotations to do some setup. But You can use Netflix hystrix without using spring cloud(spring boot) at all.

You need to extendd HystrixCommand class where ever you want to provide circuitbreaker functionality.
Check out their github page. It has lot of details.
https://github.com/Netflix/Hystrix/wiki/Getting-Started

Upvotes: 2

Abhishek Galoda
Abhishek Galoda

Reputation: 3054

Adding dependency worked for me

    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-hystrix', version: '1.4.3.RELEASE'

Upvotes: 0

Related Questions