Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.91 KB | None | 0 0
  1. @Path("/service")
  2. public class TraceableService {
  3.     final private Random random = new Random();
  4.  
  5.     TraceableServiceInterface client;
  6.     TraceableService() {
  7.         client = new Feign.Builder().target(TraceableServiceInterface.class, "http://localhost:8080");
  8.     }
  9.  
  10.     @GET
  11.     @Path("/aaaa")
  12.     public String aaaaEndpoint() throws InterruptedException {
  13.         String responseB = client./*api().*/bbbbEndpoint();
  14.         String responseC = client./*api().*/ccccEndpoint();
  15.         Thread.sleep(random.nextInt(1000));
  16.         return "aaaa-res:" + responseB + ":" + responseC;
  17.     }
  18.  
  19.     @GET
  20.     @Path("/bbbb")
  21.     public String bbbbEndpoint() throws InterruptedException {
  22.         String responseD = client./*api().*/ddddEndpoint();
  23.         String responseE = client./*api().*/eeeeEndpoint();
  24.         Thread.sleep(random.nextInt(1000));
  25.         return "bbbb-res:" + responseD + ":" + responseE;
  26.     }
  27.  
  28.     @GET
  29.     @Path("/cccc")
  30.     public String ccccEndpoint() throws InterruptedException {
  31.         String responseF = client./*api().*/ffffEndpoint();
  32.         Thread.sleep(random.nextInt(1000));
  33.         return "cccc-res:" + responseF;
  34.     }
  35.  
  36.     @GET
  37.     @Path("/dddd")
  38.     public String ddddEndpoint() throws InterruptedException {
  39.         Thread.sleep(random.nextInt(1000));
  40.         return "dddd";
  41.     }
  42.  
  43.     @GET
  44.     @Path("/eeee")
  45.     public String eeeeEndpoint() throws InterruptedException {
  46.         Thread.sleep(random.nextInt(1000));
  47.         return "eeee";
  48.     }
  49.  
  50.     @GET
  51.     @Path("/ffff")
  52.     public String ffffEndpoint() throws InterruptedException {
  53.         String responseG = client./*api().*/ggggEndpoint();
  54.         Thread.sleep(random.nextInt(1000));
  55.         return "ffff-res:" + responseG  ;
  56.     }
  57.  
  58.     @GET
  59.     @Path("/gggg")
  60.     public String ggggEndpoint() throws InterruptedException {
  61.         Thread.sleep(random.nextInt(1000));
  62.         return "gggg";
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement