Details
Description
After updating from Camel 3.4.4 to 3.11.2 our REST Services aren'T working anymore.
Already discussed here: https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/Problem.20with.20REST.20services.20after.20upgrading.20to.20Camel.203.2E11.2E2/near/255227937
Debugging revealed the following:
we create a Osgi Camel Context and register Routes like this:
camelContext = new OsgiDefaultCamelContext(bundleContext) { @Override public void init() { final RouteBuilder routes = createRoutes(); routes.restConfiguration().componentProperty("servletName", "my.custom.servletName").clientRequestValidation(true); this.addRoutes(routes); super.init(); }
In org.apache.camel.component.servlet.ServletComponent.connect(HttpConsumer)
sc.getEndpoint().getServletName()
returns the Default Servlet Name
CamelServlet
and not my
my.custom.servletName
because
org.apache.camel.component.servlet.ServletEndpoint.setServletName(String)
is called with
CamelServlet
and not with my custom servletname.
Seems like no one is setting the correct value on
org.apache.camel.component.servlet.ServletComponent.setServletName(String)