Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.4 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.4 KB

app-bwi

management.security.enabled=false
management.context-path=/actuator

By default hystrix dashboard url will be ../actuator/hystrix.stream after enter url you can specify app name and delay interval

spring boot hystrix implementation example

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
			<version>1.4.4.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
			<version>1.4.4.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
			<version>${spring-boot-starter.version}</version>
		</dependency>

Java code example

    @HystrixCommand(fallbackMethod = "defaultGreeting")
    public Long someMethod(String data){
        return service.getExternalData(data);
    }
    
    private Long defaultGreeting(String data) {
        return 1L;
    }

And Finally you have to add hystrix annotation to main class

@EnableHystrixDashboard
@EnableCircuitBreaker
@SpringBootApplication
public class MyApplication {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}