...
Code Block |
---|
@HystrixCommand(commandKey = “ExtDep1”"ExtDep1", fallbackMethod=“recommendFallback”"recommendFallback") public String anyMethodWithExternalDependency1() { URI uri = URI.create("http://172.32.1.22:8090/recommended"); String result = this.restTemplate.getForObject(uri, String.class); return result; } public String recommendFallback() { return "No recommend available"; } |
...
Code Block |
---|
@HystrixCommand(commandKey = “ExtDep1”"ExtDep1", fallbackMethod=“recommendFallback”"recommendFallback", commandProperties = { @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "500") }) public String anyMethodWithExternalDependency1() { URI uri = URI.create("http://172.32.1.22:8090/recommended"); String result = this.restTemplate.getForObject(uri, String.class); return result; } public String recommendFallback() { return "No recommend available"; } |
...