apache-camel - 将嵌入式码头与 camel-cxf 结合使用
问题描述
我在我的 Camel 项目中定义了几条休息路线,现在我正在尝试使用相同的码头嵌入式服务器向我的项目添加 SOAP 服务。
我有这样的事情:
restConfiguration()
.component("jetty")
.host("0.0.0.0")
.port(8080)
;
CxfEndpoint cxfEndpoint = new CxfEndpoint();
cxfEndpoint.setCamelContext(getContext());
cxfEndpoint.setServiceClass(TestService.class);
cxfEndpoint.setAddress("http://0.0.0.0:8080/test");
from(cxfEndpoint)
.log(LoggingLevel.INFO, log, "test");
当我尝试运行应用程序时,我收到以下错误消息:
Web 服务器无法启动。端口 8080 已被使用。
看起来它正在尝试使用相同的端口启动 2 个 Jetty 实例,这就是它失败的原因。
我真的很想让 cxf 端点与用于我的其他服务的嵌入式 Jetty 一起工作。有没有办法做到这一点?
解决方案
推荐阅读
- python - Pyinstaller,python。pre-safe-import-module 钩子失败,需要修复
- python - Selenium Webdriver 卡在 Cloadflare DDos 保护上。如何手动绕过?
- python - usb_device_handle_win.cc:1048 无法从节点连接读取描述符
- javascript - 如何使 API 服务器始终在线?
- wordpress - 仅当用户角色是订阅者和网站访问者时才显示 (Wordpress)
- c - 有没有办法从未知字节中设置/清除一个位,同时保持所有其他位不变?
- mongodb - 如何使用 Kmongo 将图像保存到 mongoDB 集合中?
- enums - Java 中的位域枚举:何时定义数值
- c# - 使用 C# 和 MediaInfo 如何检测 HDR 格式
- python - Python3中的复数数据类型