My task is to use Spring Boot to check several URLs/Endpoints and to run a fallback method if this endpoint is not available. So I start an hystrix instance by using the endpoint name as key.
HystrixCommandKey commandKey = HystrixCommandKey.Factory.asKey(key);
HystrixCommandProperties commandProperties = HystrixPropertiesFactory.getCommandProperties(commandKey, null);
HystrixThreadPoolKey threadPoolKey = HystrixThreadPoolKey.Factory.asKey(key);
HystrixCommandMetrics hystrixCommandMetrics = HystrixCommandMetrics.getInstance(commandKey,
HystrixCommandGroupKey.Factory.asKey("transfer"), threadPoolKey, commandProperties);
ConfigurationManager.getConfigInstance().setProperty("hystrix.command.default.circuitBreaker.enabled", "true");
ConfigurationManager.getConfigInstance().setProperty("hystrix.command.default.execution.timeout.enabled",
"false");
ConfigurationManager.getConfigInstance()
.setProperty("hystrix.command.default.circuitBreaker.requestVolumeThreshold", "5");
ConfigurationManager.getConfigInstance()
.setProperty("hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds", "500");
Now I'm facing that I can not commit any incoming request or class to this hystrix instance. Maybe somebody know how to solve that or has found a good tutorial to do this. kind regards
Markus