Show Table of Contents
20.2.5. Netty サーブレットの設定
サーブレットトランスポートを使用すると、HTTP 上で HornetQ トラフィックをサーブレットエンジンで稼働しているサーブレットへトンネリングできます。サーブレットエンジンは HornetQ トラフィックを in-VM HornetQ サーバーへリダイレクトします。Netty HTTP トランスポートは、特定ポート上で HTTP トラフィックをリッスンする Web サーバーとして動作します。サーブレットトランスポートでは、HornetQ トラフィックはすでに Web サイトや他のアプリケーションを提供している可能性があるサーブレットエンジンを介してルーティングされます。
Netty サーブレットトランスポートが動作するようにサーブレットエンジンを設定するには、以下の手順に従います。
- サーブレットをデプロイします。以下の例はサーブレットを使用する Web アプリケーションを表しています。
<web-app> <servlet> <servlet-name>HornetQServlet</servlet-name> <servlet-class>org.jboss.netty.channel.socket.http.HttpTunnelingServlet</servlet-class> <init-param> <param-name>endpoint</param-name> <param-value>local:org.hornetq</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HornetQServlet</servlet-name> <url-pattern>/HornetQServlet</url-pattern> </servlet-mapping> </web-app>初期化パラメーターendpointは、サーブレットがパケットを転送する Netty アクセプターのホスト属性を指定します。 - Netty サーブレットアクセプターをサーバー側の設定上で挿入します。以下の例は、サーバー設定ファイル (
standalone.xmlおよびdomain.xml) でのアクセプターの定義を示しています。<acceptors> <acceptor name="netty-servlet"> <factory-class> org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory </factory-class> <param key="use-servlet" value="true"/> <param key="host" value="org.hornetq"/> </acceptor> </acceptors> - 最後に、サーバー設定ファイル (
standalone.xmlおよびdomain.xml) でクライアントの接続を定義します。<netty-connector name="netty-servlet" socket-binding="http"> <param key="use-servlet" value="true"/> <param key="servlet-path" value="/messaging/HornetQServlet"/> </netty-connector>
- また、以下の設定をコネクターに追加すると、サーブレットトランスポートを SSL 上でも使用できます。
<netty-connector name="netty-servlet" socket-binding="https"> <param key="use-servlet" value="true"/> <param key="servlet-path" value="/messaging/HornetQServlet"/> <param key="ssl-enabled" value="true"/> <param key="key-store-path" value="path to a key-store"/> <param key="key-store-password" value="key-store password"/> </connector>
警告
自動クライアントフェイルオーバーは、HTTP トンネリングサーブレットを介して接続しているクライアントに対してはサポートされません。
注記
HornetQ クラスターの設定するために Netty サーブレットを使用して EAP 6 サーバーを設定することはできません。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.