Apache Camel REST Endpoint and Servlet Name

This problem took me a few hours to solve at my current client.

Apache Camel provides a way to expose routes as REST endpoints:

 .route().routeId("esb-parisbridge rest")
 .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(200))
 .transform(constant("Completed Request successfully"));

Now when you are deploying multiple WARs into one app server the CamelHttpTransportServlet is there multiple times with the same name.

To make this work you need to rename the servlet name to a unique name:
    <display-name>Camel Http Transport Servlet</display-name>

The problem now is that Camel does not know about the changed name and you will get a 404 not found when trying to access the REST endpoint.

You must tell the Camel servlet component what the name of the servlet will be:
  .endpointProperty("servletName", "CamelServletParisBridge");