Camel rest URI使用后缀
因此,我有一个使用Camel的REST web服务 它工作得很好,只是如果我用后缀调用我的URI,我会得到相同的响应,而不是404 Rest配置:Camel rest URI使用后缀,rest,apache-camel,Rest,Apache Camel,因此,我有一个使用Camel的REST web服务 它工作得很好,只是如果我用后缀调用我的URI,我会得到相同的响应,而不是404 Rest配置: restConfiguration() .component("restlet") .bindingMode(RestBindingMode.json) .dataFormatProperty("prettyPrint", "true") .contextPath(contextPath).host(host).port(port); res
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")
例如:
本地主机:8090/service/ressource
返回我的资源
本地主机:8090/service/ressource85468461569
返回我的资源
这正常吗?我认为它应该返回404是的,这是目前不支持的
我已经记录了一个问题来改进这一点:您的rest服务是如何配置的?restConfiguration().component(“restlet”).bindingMode(RestBindingMode.json).dataFormatProperty(“prettyPrint”,“true”).contextPath(contextPath).host(host).port(port);rest(“/ressource”).description(“ressource”).consumes(“application/json”).Products(“application/json”).get().outType(ressource.class)。to(“bean:ressourceImpl?method=getRessource”)您使用的是什么版本的Camel?@ClausIbsen它看起来像一个bug。这可以正确地与
netty4 http
组件一起工作。只有使用restlet
它看起来像一个bug。更改如下restConfiguration().component(“netty4 http”)
并重试