JMS Nodes サンプルを実行する前に、JNDI 管理対象オブジェクトを作成する必要があります。サンプルでは、WebSphere MQ が JMS プロバイダーとして使用されるので、JMSAdmin ツールで管理対象オブジェクトを作成しなければなりません。
JMSAdmin ツールは、Unix の場合には install_dir/java/bin にあり、Windows の場合には install_dir¥java¥bin にあります (install_dir は、WebSphere MQ のインストール先ディレクトリー)。
JMS Nodes サンプル・フロー・プロジェクトには、JMSAdmin ツールと共に使用する必要のある、JMSSampleObjects.defs という 1 つのファイルがあります。
JMSAdmin ツールを使用する前に、JMSAdmin.config ファイルを次のように変更してください。
JMSAdmin.config ファイルを変更するには次のようにします。
# The following line specifies which JNDI service provider is in use.
# It currently indicates an LDAP service provider. If a different
# service provider is used, this line should be commented out and the
# appropriate one should be uncommented.
#
#INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
#
# The following line specifies the URL of the service provider's initial
# context. It currently refers to an LDAP root context. Examples of a
# file system URL and WebSphere's JNDI namespace are also shown, commented out.
#
#PROVIDER_URL=ldap://polaris/o=ibm,c=us
PROVIDER_URL=file:/C:¥JNDI-Directory
#PROVIDER_URL=iiop://localhost/
#
ファイルを保管したら、PROVIDER_URL 行にあるとおり、JNDI-Directory ディレクトリーを作成します。
<myuser>
をブローカーを実行するために使用するユーザー名に置き換えます。
ファイルを保管したら、PROVIDER_URL 行にあるとおり、JNDI-Directory ディレクトリーを作成します。
# The following line specifies the URL of the service provider's initial
# context. It currently refers to an LDAP root context. Examples of a
# file system URL and WebSphere's JNDI namespace are also shown, commented out.
#
#PROVIDER_URL=ldap://polaris/o=ibm,c=us
PROVIDER_URL=file:///home/<myuser>/JNDI-Directory
#PROVIDER_URL=iiop://localhost/
#
これで、オブジェクトを作成する準備ができました。
JMSSampleObjects.defs ファイルを入力として使用して JMSAdmin を実行することにより、オブジェクトを作成できます。
コマンド行に、以下のコマンドを入力します。
WebSphere MQ JMS Provider インプリメンテーション JAR ファイルを WebSphere Message Brokers が認識する場所へコピーする 必要があります。
メッセージ・フロー内の JMS ノードに、上で作成した .bindings ファイルの場所を指示する必要があります。
JMS ノードに .binding ファイルの位置を構成するには、次のようにします。
これでメッセージ・フローが構成され、ブローカーにデプロイする準備ができました。
JMSGateway および JMSInput_Publication フローをデプロイするために、両方のメッセージ・フローが入ったブローカー・アーカイブ (BAR) ファイルを作成します。
BAR ファイルを作成するには、次のようにします。
これで、サンプルを実行する準備ができたことになります。