Red Hat Training

A Red Hat training course is available for Red Hat Fuse

330.8. {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 ソケットバインディングで指定されたインターフェイス/ポートをリッスンするように設定されています。デフォルトでは、これは 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 で引き続き利用できます。

330.8.1. 代替ポートの設定

代替ポートを受け入れる場合は、{wildfly} サブシステム設定を介してこれらを設定する必要があります。これは、サーバーのドキュメントで説明されています。

https://access.redhat.com/documentation/ja-jp/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/configuring_the_web_server_undertow

330.8.2. {wildfly} で無視された camel-undertow コンシューマー設定オプション

hostOptions

サーバーホストオプションの設定方法については、{wildfly} undertow 設定ガイドを参照してください。

https://access.redhat.com/documentation/ja-jp/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/ja-jp/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