在此样本中,WebSphere MQ 将作为 JMS 提供程序;您必须使用 JMSAdmin 工具来创建受管对象。
注意:如果提供了多个版本的 WebSphere MQ,请选择当前所安装的版本作为主队列管理器。
以下指示信息假设已在 mq_install_dir 目录中安装 WebSphere MQ。JMSAdmin 工具和 JMSAdmin 配置文件(名为 JMSAdmin.config)位于以下位置:
需要先修改 JMSAdmin.config 文件才能使用 JMSAdmin 工具。
# The following line specifies which JNDI service provider is in use. # It currently indicates a File System Context. If a different # service provider is used, this line must be commented out, and the # appropriate one must be uncommented. # # com.sun.jndi.fscontext.RefFSContextFactory is the FileSystem JNDI Context # #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 File System Context. Examples of a # LDAP root context URL and WebSphere's JNDI namespace are also shown, commented # out. # # PROVIDER_URL needs changing to, e.g. file:///home/user/JNDI-Directory # on Unix platforms. The 'JNDI-Directory' folder needs to be created in the # location specified. # #PROVIDER_URL=ldap://localhost/o=ibm,c=us PROVIDER_URL=file:/C:/JNDI-Directory #PROVIDER_URL=iiop://localhost/
现在,您可以创建对象了。
通过运行 WebSphere MQ JMSAdmin 工具来创建 JNDI 受管对象,从而配置此样本中所用的 JMS Connection Factories 和 Destinations。
通过运行 JMSAdmin 工具并使用 JMSSampleObjects.defs 文件作为输入来创建对象。
如果 Integration 节点没有在使用端口 2414,请在 JMSSampleObjects.defs 中编辑端口设置。
通过命令行输入下列命令,并将其中的 mq_install_dir 替换为 WebSphere MQ 安装位置,将 workspace_path 替换为 IBM Integration Toolkit 工作空间目录的完整路径:
cd mq_install_dir\java\bin JMSAdmin < "workspace_path\JMSNodesSampleFlowProject\JMSSampleObjects.defs"
cd mq_install_dir/java/bin . ./setjmsenv
运行 setjmsenv 命令将设置 JMS 环境并将 com.ibm.mqjms.jar 添加到 CLASSPATH 中。JMSAdmin 需要 Java,如果尚未在 PATH 中设置 Java,那么可以使用以下命令进行添加,其中 JAVA_HOME 是 Java 的安装位置:
export PATH=$PATH:JAVA_HOME/bin
然后,运行以下 JMSAdmin 命令:
./JMSAdmin < "workspace_path/JMSNodesSampleFlowProject/JMSSampleObjects.defs"
这些对象和 .bindings 文件将在以上 JMSAdmin.config 文件中设置的 PROVIDER_URL 所指定的目录中进行创建。
接着,修改 MQInput 节点属性,以便将其连接到 .bindings 文件。
您必须通知消息流中的 JMS 节点去何处查找您刚创建的 .bindings 文件。
要使用 .bindings 文件位置配置 JMS 节点:
消息流现已配置,且可以部署到 Integration 节点。
要部署 JMSGateway 和 JMSInput_Publication 流,请创建包含这两个消息流的代理归档 (BAR) 文件。
要创建 BAR 文件:
现在您可以准备运行样本了。