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>
Copy to Clipboard Toggle word wrap

在本实例中,Undertow 配置为侦听由 http 和 https socket-binding 指定的接口 / 端口。默认情况下,这是 http 的端口 8080,https 为 8443。

这会产生以下影响:

  • camel-undertow 用户将仅绑定到 localhost:8080 或 localhost:8443
  • 有些端点消费者配置选项没有影响(请参阅以下),因为这些设置由 WildFly 容器管理

例如,如果您使用不同主机或端口组合配置端点消费者,服务器日志文件中会出现一个警告。例如,以下主机和端口配置将被忽略:

from("undertow:http://somehost:1234/path/to/resource")
Copy to Clipboard Toggle word wrap
[org.wildfly.extension.camel] (pool-2-thread-1) Ignoring configured host: http://somehost:1234/path/to/resource
Copy to Clipboard Toggle word wrap

但是,在默认主机和端口 localhost:8080 或 localhost:8443 上仍提供使用者。

358.10.1. 配置其他端口

如果接受其他端口,则必须通过 WildFly 子系统配置它们。这在服务器文档中解释:

https://access.redhat.com/documentation/zh-cn/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/configuring_the_web_server_undertow

hostOptions

有关如何配置服务器主机选项,请参阅 WildFly undertow 配置指南:

https://access.redhat.com/documentation/zh-cn/red_hat_jboss_enterprise_application_platform/7.1/html-single/how_to_configure_server_security/#configure_one_way_and_two_way_ssl_tls_for_application

sslContextParameters

要配置 SSL,请参阅 WildFly SSL 配置指南:

https://access.redhat.com/documentation/zh-cn/red_hat_jboss_enterprise_application_platform/7.1/html-single/how_to_configure_server_security/#configure_one_way_and_two_way_ssl_tls_for_application

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat