Request doesn't forward to endpoint mentioned in Camel's loadbalancer EIP.

Solution Verified - Updated -

Issue

  • In our route camel-jetty endpoint works as proxy and based on path-uri the incoming request is sent to camel loadbalancer EIP.
  • But request is not being sent/forwarded/loadbalanced by Camel loadbalancer EIP. We have following route.
 public class CamelRouter extends RouteBuilder {

    Predicate p1 = header("CamelHttpUri").isEqualTo("/time/now");
    @Override
    public void configure() throws Exception {

        from("jetty:http://0.0.0.0:8081?matchOnUriPrefix=true")
                .onException(HttpOperationFailedException.class, SSLHandshakeException.class)
                .handled(true)
                .setBody(constant("Error Connecting to the service"))
                .setHeader("CamelHttpResponseCode",constant(502))
                .end()
                .log("${headers.CamelHttpUri}")
                .choice()
                .when(p1)
                .to("direct:A");

        from("direct:A")
                .loadBalance()
                .failover(1,
                        false,
                        false,
                        false, HttpOperationFailedException.class,SSLHandshakeException.class)

                .to("https4://IP!:8081/test?bridgeEndpoint=true", "https4://IP2:8082/test?bridgeEndpoint=true")
                .log("${body}");

Environment

  • Red Hat Fuse 7.x
    • OpenShift 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In