358.10. WildFly 上的 Undertow 用户
WildFly 上的 camel-undertow 用户配置与独立 Camel 的配置不同。生产者端点可以正常运行。
在 WildFly 上,camel-undertow 用户利用容器提供的默认 Undertow HTTP 服务器。服务器在 undertow 子系统配置中定义。以下是 standalone.xml 中默认配置的摘录:
<subsystem xmlns="urn:jboss:domain:undertow:4.0">
<buffer-cache name="default" />
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" />
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true" />
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content" />
<filter-ref name="server-header" />
<filter-ref name="x-powered-by-header" />
<http-invoker security-realm="ApplicationRealm" />
</host>
</server>
</subsystem>
在本实例中,Undertow 配置为侦听 http 和 https socket-binding 指定的接口/端口。默认情况下,对于 http,对于端口 8080,https 为 8443。
这有以下影响:
- camel-undertow 用户将仅绑定到 localhost:8080 或 localhost:8443
- 有些端点消费者配置选项无效(请参阅以下),因为这些设置由 WildFly 容器管理
例如,如果您使用不同的主机或端口组合配置端点使用者,服务器日志文件中会显示警告。例如,以下主机和端口配置将被忽略:
from("undertow:http://somehost:1234/path/to/resource")
[org.wildfly.extension.camel] (pool-2-thread-1) Ignoring configured host: http://somehost:1234/path/to/resource
但是,消费者在默认主机和端口 localhost:8080 或 localhost:8443 上仍然可用。
358.10.1. 配置替代端口 复制链接链接已复制到粘贴板!
如果要接受替代端口,则必须通过 WildFly 子系统配置它们。这在服务器文档中解释:
358.10.2. 在 WildFly 中忽略了 camel-undertow 消费者配置选项 复制链接链接已复制到粘贴板!
hostOptions
有关如何配置服务器主机选项,请参阅 WildFly undertow 配置指南:
sslContextParameters
要配置 SSL,请参阅 WildFly SSL 配置指南: