Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Path("/service")
- public class TraceableService {
- final private Random random = new Random();
- TraceableServiceInterface client;
- TraceableService() {
- client = new Feign.Builder().target(TraceableServiceInterface.class, "http://localhost:8080");
- }
- @GET
- @Path("/aaaa")
- public String aaaaEndpoint() throws InterruptedException {
- String responseB = client./*api().*/bbbbEndpoint();
- String responseC = client./*api().*/ccccEndpoint();
- Thread.sleep(random.nextInt(1000));
- return "aaaa-res:" + responseB + ":" + responseC;
- }
- @GET
- @Path("/bbbb")
- public String bbbbEndpoint() throws InterruptedException {
- String responseD = client./*api().*/ddddEndpoint();
- String responseE = client./*api().*/eeeeEndpoint();
- Thread.sleep(random.nextInt(1000));
- return "bbbb-res:" + responseD + ":" + responseE;
- }
- @GET
- @Path("/cccc")
- public String ccccEndpoint() throws InterruptedException {
- String responseF = client./*api().*/ffffEndpoint();
- Thread.sleep(random.nextInt(1000));
- return "cccc-res:" + responseF;
- }
- @GET
- @Path("/dddd")
- public String ddddEndpoint() throws InterruptedException {
- Thread.sleep(random.nextInt(1000));
- return "dddd";
- }
- @GET
- @Path("/eeee")
- public String eeeeEndpoint() throws InterruptedException {
- Thread.sleep(random.nextInt(1000));
- return "eeee";
- }
- @GET
- @Path("/ffff")
- public String ffffEndpoint() throws InterruptedException {
- String responseG = client./*api().*/ggggEndpoint();
- Thread.sleep(random.nextInt(1000));
- return "ffff-res:" + responseG ;
- }
- @GET
- @Path("/gggg")
- public String ggggEndpoint() throws InterruptedException {
- Thread.sleep(random.nextInt(1000));
- return "gggg";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement