我尝试使用camel实现负载均衡,并使用以下代码从server获取响应。但是,不调用其余服务。
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {
System.out.println("inside configure....");
from(
"http://localhost:9876/LunaHSMLoadBalancer/csr/getSignature")
.loadBalance()
.roundRobin()
.to("http://localhost:8080/test/services/token/signature",
"http://10.65.49.216:8080/test/services/token/signature");
}
});
context.start();
Thread.sleep(900000);
context.stop();