我们正在使用带有CXF endpoints 的Apache Camel来处理我们的Web服务请求 . 我希望能够做的是让我的应用程序能够接受任何URL上的消息,例如:
http://localhost:9000/[anything]/MyService
http://localhost:9000/foo/MyService
http://localhost:9000/bar/MyService
我想我可以将它设置为可配置的设置,但我更愿意让它完全动态并接受我的服务名称之前的任何路径组件 . 我已经读过Camel URL Rewrite Component,看起来这可能有用,但感觉不是正确的答案 .
如果它有帮助,我的 endpoints 配置(为简洁起见,删除了一些细节):
<cxf:cxfEndpoint id="MessageEndpoint"
serviceClass="MyClass"
serviceName="RespondingGateway_PortType"
address="{{web-service-url}}:{{port}}/subpath/MyService">
</cxf:cxfEndpoint>
我希望能够做的是在地址属性中添加 /*/subpath/MyService
之类的内容以匹配任何内容,但这不起作用 .