IBM MQ 定制属性
WebSphere® Application Server 支持使用定制属性来定义 IBM MQ 属性。此功能非常有用,这是因为它使 WebSphere Application Server 能够与 IBM MQ 的更高版本配合工作,而那些版本可能具有在 WebSphere Application Server 管理控制台中未提供的属性。
对于 WebSphere Application Server V7.0 或更高版本,您定义的定制属性将由 WebSphere Application Server 中包含的 IBM MQ 资源适配器进行验证。在早期发行版中,此校验在 WebSphere Application Server 自身中完成,然后由 IBM MQ 客户机 JAR 文件进行验证。如果您定义了对 IBM MQ 无效的属性,那么 IBM MQ 资源适配器将生成异常,WebSphere Application Server 会捕获该异常并将其记录在 Systemout.log 和 SystemErr.log 文件中。本主题末尾提供了错误消息示例。
当 WebSphere Application Server 安装版本支持的更高版本的 IBM MQ 可用时,可能会创建 WebSphere Application Server 未知的新 IBM MQ 属性。可以通过 WebSphere Application Server 将这些属性作为定制属性进行配置,以便 IBM MQ 资源适配器可以识别这些属性。还可以将 WebSphere Application Server 配置为指向外部 JMS 提供程序中的 IBM MQ 资源适配器,如对 IBM MQ 消息传递提供程序配置本机库信息中所述。
有关 IBM MQ 属性的有效值的信息,请参阅 IBM MQ 信息中心的“使用 Java™”和“系统管理”部分。
下列方案说明影响单元配置的方式的不同。
混合节点方案
在此混合节点方案中,单元由一个 WebSphere Application Server V9.0 Deployment Manager、两个 WebSphere Application Server V6 节点和两个 WebSphere Application Server V9.0 节点组成。如果 IBM MQ 连接工厂是在单元级别定义的,并且定义了定制属性(他们将使用 IBM MQ 中提供的新字段),那么该连接工厂仅绑定至 V9.0 级别的 WebSphere Application Server 单元。WebSphere Application Server V6 节点无法识别新的 IBM MQ 属性,也不会绑定至 Java 命名和目录接口 (JNDI)。WebSphere Application Server V9.0 的增强功能允许将这些属性的验证委派给 IBM MQ 资源适配器来执行。
WebSphere MQ V7 或更高版本方案
在此方案中,单元由 WebSphere Application Server V9.0 Deployment Manager 和节点组成。IBM MQ 消息传递提供程序将在高于 V6 的级别中运行。WebSphere Application Server 将使用 WebSphere Application Server V9.0 附带提供的缺省 IBM MQ 资源适配器。在此方案中,IBM MQ 资源适配器无法识别新 IBM MQ 属性,所以验证将失败并且连接工厂不会绑定至 JNDI。
正确配置的方案
在此方案(与上一个方案类似)中,单元由 WebSphere Application Server V9.0 Deployment Manager 和节点组成。IBM MQ 消息传递提供程序将在高于 V6 的级别中运行。要成功使用新的 IBM MQ 属性,需要将 WebSphere Application Server 配置为指向与 IBM MQ 的更高版本相关联的 IBM MQ 资源适配器。
错误消息示例
资源适配器产生的异常包含错误消息,他们类似于以下示例:[09/02/06 15:40:06:377 GMT] 0000000a ContainerImpl E WSVR0501E: Error creating
component null [class com.ibm.ws.runtime.component.ApplicationServerImpl]
com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.runtime.component.binder.
ResourceBindingException: invalid configuration passed to resource binding logic.
REASON: Failed to create connection factory: Error raised constructing AdminObject,
error code: XAQCF PropertyName : XAQCF PropertyName
其中属性名是无效属性的名称。