Package com.fluxcapacitor.edge.hystrix

Examples of com.fluxcapacitor.edge.hystrix.GetLogsCommand


    try {
      // increment request counter
      requestCounter.increment();

      // invoke service through Hystrix
      HystrixCommand<String> getCommand = new GetLogsCommand(key);
      Future<String> future = getCommand.queue();
      String responseString = future.get();

      // increment the fallback counter if the response came from a
      // fallback
      // TODO: this isn't needed as the hystrix framework exports its own
      // metrics on a per-command basis.
      // this is here for demo purposes.
      if (getCommand.isResponseFromFallback()) {
        fallbackCounter.increment();
      }

      // increment the timeout counter if the response timed out and
      // triggered fallback
      // TODO: this isn't needed as the hystrix framework exports its own
      // metrics on a per-command basis.
      // this is here for demo purposes.
      if (getCommand.isResponseTimedOut()) {
        timeoutCounter.increment();
      }

      // return response
      return Response.ok(responseString).build();
View Full Code Here

TOP

Related Classes of com.fluxcapacitor.edge.hystrix.GetLogsCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.