cheeghi
cheeghi

Reputation: 97

Apache Camel corrupted http response

I'm using Camel to route http requests. A client reaches my Camel router at a servlet endpoint providing the information required to route the request, then I lookup into the database to resolve the endpoint. The requests are routed correctly but the response I get seems to be corrupted (I'm making the call from a Rest client), here the corrupted response:

enter image description here

If I call the destination endpoint without passing from camel it returns the right response:

enter image description here

I also checked that the response leaves the destination endpoint not corrupted.

Here my Camel configuration classes:

@Singleton
@Startup
public class CamelStartupBean {

    @PostConstruct
    public void init() {
        CamelContext camelContext = new DefaultCamelContext();
        camelContext.addRoutes(new CamelRouteConfiguration());
        camelContext.start();
    }

    static class CamelRouteConfiguration extends RouteBuilder {

        @Override
        public void configure() {
            from("servlet:callService?matchOnUriPrefix=true")
                    .routeId("callService")
                    .recipientList(method(CallServiceConfiguration.class, "resolveServiceRoute"));
        }

    }

    static class CallServiceConfiguration {

        public String resolveServiceRoute(Exchange exchange) {
            String route;
            // lookup the database to find a route ...
            route = "http://demo.apps.closhlab.osh.local/rest/DemoService?bridgeEndpoint=true";
            return route;
        }

    }

}

I'm using Camel 3.9.0 and my app is deployed on the Docker image jboss/wildfly:15.0.0.Final.

Any idea? Thank you.

Upvotes: 0

Views: 170

Answers (1)

cheeghi
cheeghi

Reputation: 97

Upgrading to Camel 3.11.0 solved the issue.

Upvotes: 0

Related Questions