|
@ -2,7 +2,6 @@ package camel.gateway.route;
|
|
|
|
|
|
import camel.gateway.processor.ErrorHandle;
|
|
|
import camel.gateway.processor.GatewayProcessor;
|
|
|
import camel.gateway.processor.SignProcessor;
|
|
|
import camel.gateway.processor.WsProcessor;
|
|
|
import org.apache.camel.Exchange;
|
|
|
import org.apache.camel.builder.RouteBuilder;
|
|
@ -38,18 +37,15 @@ public class GatewayRouterBuilder extends RouteBuilder {
|
|
|
.when(header(Exchange.HTTP_URI).contains("unauthorizedError")).bean(new ErrorHandle(), "unauthorizedError")
|
|
|
.endChoice();
|
|
|
|
|
|
from("jetty:http://0.0.0.0:9999/healthy").routeId("healthy")
|
|
|
from("jetty:http://0.0.0.0:9999/ping").routeId("heartbeat")
|
|
|
.transform(constant("pong"))
|
|
|
.log("=========================心跳测试=====================");
|
|
|
|
|
|
from("jetty:http://0.0.0.0:9999/sign").routeId("sign")
|
|
|
.process(new SignProcessor());
|
|
|
|
|
|
from(SIMPLE_ENDPOINT_URI)
|
|
|
.setHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY, constant(true))
|
|
|
.process(new WsProcessor())
|
|
|
.routingSlip(method(GatewayProcessor.class, "route"))
|
|
|
.to("bean:wsProcessor?method=responseWs")
|
|
|
;
|
|
|
.to("bean:wsProcessor?method=responseWs");
|
|
|
}
|
|
|
|
|
|
}
|