Camel rest URI works with suffix

2019-07-24 06:21发布

问题:

So I have a REST webservice using Camel.

it works just fine except that if I call my URI with a suffix I get the same response and not a 404.

Rest Configuration:

restConfiguration()
.component("restlet")
.bindingMode(RestBindingMode.json) 
.dataFormatProperty("prettyPrint", "true") 
.contextPath(contextPath).host(host).port(port); 

rest("/ressource") .description("ressource")
.consumes("application/json") .produces("application/json") 
.get().outType(Ressource.class)
.to("bean:ressourceImpl?method=getRessource")

Example :

localhost:8090/service/ressource

returns my ressource

localhost:8090/service/ressource85468461569

returns my ressource

Is it normal ? I thought it should just return 404

回答1:

Yes this is currently not supported.

I have logged a ticket to improve this: https://issues.apache.org/jira/browse/CAMEL-12320