Skip to content

Commit 3c31664

Browse files
author
sbalachandran
committed
Updated with Hystrix integration to spring app
1 parent 6f2ccdf commit 3c31664

10 files changed

Lines changed: 51 additions & 15 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.baeldung.hystrix;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.context.ApplicationContext;
6+
7+
@SpringBootApplication
8+
public class AppConfig {
9+
10+
public static void main(String[] args) {
11+
SpringApplication.run(AppConfig.class, args);
12+
}
13+
}

hystrix/src/test/java/com/baeldung/hystrix/CommandHelloWorld.java renamed to hystrix/src/main/java/com/baeldung/hystrix/CommandHelloWorld.java

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.baeldung.hystrix;
2+
3+
/**
4+
* Created by sbalachandran on 8/5/2016.
5+
*/
6+
public class HystrixAspect {
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.baeldung.hystrix;
2+
3+
/**
4+
* Created by sbalachandran on 8/5/2016.
5+
*/
6+
public class HystrixCircuitBreaker {
7+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.baeldung.hystrix;
2+
3+
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.web.bind.annotation.RequestMapping;
5+
import org.springframework.web.bind.annotation.RestController;
6+
7+
@RestController
8+
public class HystrixController {
9+
10+
@Autowired
11+
private SpringExistingClient client;
12+
13+
@RequestMapping("/")
14+
public String index() throws InterruptedException{
15+
return client.invokeRemoteService();
16+
}
17+
}

‎hystrix/src/main/java/com/baeldung/hystrix/RemoteServiceSimulator.java‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

hystrix/src/test/java/com/baeldung/hystrix/RemoteServiceTestCommand.java renamed to hystrix/src/main/java/com/baeldung/hystrix/RemoteServiceTestCommand.java

File renamed without changes.

hystrix/src/test/java/com/baeldung/hystrix/RemoteServiceTestSimulator.java renamed to hystrix/src/main/java/com/baeldung/hystrix/RemoteServiceTestSimulator.java

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.baeldung.hystrix;
2+
3+
/**
4+
* Created by sbalachandran on 8/5/2016.
5+
*/
6+
public class SpringExistingClient {
7+
}

‎hystrix/src/main/resources/application.properties‎

Whitespace-only changes.

0 commit comments

Comments
 (0)