Camel rest URI works with suffix

时间秒杀一切 提交于 2019-12-24 00:59:47

问题


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



来源:https://stackoverflow.com/questions/49070854/camel-rest-uri-works-with-suffix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!