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 指定的接口/端口。默认情况下,这是 https 和 8443 的端口 8080。

这有以下影响:

  • 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 子系统配置来配置这些端口。这在服务器文档中阐述:

https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/configuring_the_web_server_undertow

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.