示例代码
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(
new HystrixRouteBuilder());
context.start();
startHystrixServlet();
System.in.read();
context.stop();
}
public class HystrixRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("jetty:http://localhost:8080/hystrix").log("${headers}").log("${body}")
.hystrix()
.hystrixConfiguration()
.groupKey("http2http${header.CamelHttpQuery}")
.circuitBreakerErrorThresholdPercentage(20)
.executionTimeoutInMilliseconds(25)
.end()
.to("jetty://