WSReliableMessaging 策略和绑定属性
使用 setPolicyType 和 setBinding 命令的 attributes 参数为 ReliableMessaging 策略和策略集绑定指定更多配置信息。WSReliableMessaging 服务质量 (QoS) 仅可用于应用程序策略集。
WSReliableMessaging 是两个端点之间进行可靠消息传输应遵循的互操作性标准。当两个企业之间使用 Web Service 时,使用 WSReliableMessaging 来保护和验证事务。
- 将 -attributes 参数用于 getPolicyType 和 getBinding 命令以查看策略和绑定配置的属性。要获取属性,请将属性名传递至 getPolicyType 或 getBinding 命令。
- 将 -attributes 参数用于 setPolicyType 和 setBinding 命令以在策略和绑定配置中添加、更新或除去属性。要添加或属性更新,请指定属性名和属性值。如果该属性存在,那么 setPolicyType 和 setBinding 命令更新该值;如果该属性不存在,那么会添加该属性及值。要除去属性,请指定属性值为空字符串 ("")。-attributes 参数接受属性对象。

为了支持混合单元环境,WebSphere Application Server 支持 V7.0 和 V6.1 绑定。常规单元级别绑定是特定于 V7.0 和更高版本的绑定。特定于应用程序的绑定保留在该应用程序所需要的版本处。当用户创建特定于应用程序的绑定时,应用程序服务器将决定要用于应用程序所必需的绑定版本。
WSReliableMessaging 策略属性
- specLevel
- 选择 WS-ReliableMessaging 标准并将它用于消息的可靠传输。WS-ReliableMessaging V1.1 规范是缺省值。使用以下信息来选择规范级别:
- 指定 1.0 作为 specLevel 属性的值,以使用 2005 年 2 月发布的 WS-ReliableMessaging V1.0 这一规范级别。
- 指定 1.1 作为 specLevel 属性的值,以使用 2006 年 8 月发布的 OASIS WS-ReliableMessaging V1.1 这一规范级别。
以下示例代码将 specLevel 属性设置为 2006 年 8 月发布的 OASIS WS-ReliableMessaging V1.1 规范:AdminTask.setPolicyType('[-policySet "CustomWSReliableMessaging" -policyType WSReliableMessaging -attributes "[[specLevel 1.1]]"]')
- inOrderDelivery
- 指定是否按消息的接收顺序来处理消息。如果使用 inOrderDelivery 属性,那么入站消息可能会排队并等待先前的消息。以下示例代码启用了 inOrderDelivery 属性:
AdminTask.setPolicyType('[-policySet "CustomWSReliableMessaging" -policyType WSReliableMessaging -attributes "[[inOrderDelivery true]]"]')
- qualityOfService
- 指定要使用的 WSReliableMessaging 服务的服务质量。为 qualityOfService 属性定义以下三个值之一:
- unmanagedNonPersistent
此设置允许发生网络和远程系统故障。unmanagedNonPersistent 服务质量不是事务性的。在配置了此设置的情况下,如果服务器发生故障,那么将丢失消息。仅当将环境配置为 Web Service 请求者时,此服务质量才支持这些环境。
- managedNonPersistent
此设置允许发生系统、网络和远程系统故障。但是,当消息传递引擎重新启动时,就会废弃消息状态。managedNonPersistent 服务质量不是事务性的。此设置可防止在服务器发生故障时丢失消息。但是,如果消息传递引擎发生故障,还是会丢失消息。受管客户机应用程序和瘦客户机应用程序不能使用此服务质量。
- managedPersistent
此设置允许发生系统、网络和远程系统故障。使用此设置时,将在事务中处理消息,并将它们持久保存在 Web Service 请求者和提供者中。在服务器发生故障时可以恢复消息。对于在发生故障时未成功传输的消息,当消息传递引擎或应用程序重新启动时将继续传输这些消息。受管客户机应用程序和瘦客户机应用程序不能使用此服务质量。
以下示例将 qualityOfService 属性设置为 unmanagedNonPersistent:AdminTask.setPolicyType('[-policySet "CustomWSReliableMessaging" -policyType WSReliableMessaging -attributes "[[qualityOfService unmanagedNonPersistent]]"]')
- unmanagedNonPersistent
AdminTask.setPolicyType('[-policySet "CustomWSReliableMessaging" -policyType
WSReliableMessaging -attributes "[[specLevel 1.1][inOrderDelivery true][qualityOfService
unmanagedNonPersistent]]"]')
WSReliableMessaging 绑定配置属性
- busName
- 包含要用于服务质量选项 managedNonPersistent 或 managedPersistent 的消息传递引擎的服务集成总线的名称。以下示例将 busName 属性设置为 myBus:
AdminTask.setBinding('[-bindingLocation "" -bindingName cellWideBinding2 -policyType WSReliableMessaging -attributes "[[busName myBus]]"]')
- messagingEngineName
- 要用于服务质量选项 managedNonPersistent 或 managedPersistent 的消息传递引擎的名称。以下示例将 messagingEngineName 属性设置为 messagingEngine001:
AdminTask.setBinding('[-bindingLocation "" -bindingName cellWideBinding2 -policyType WSReliableMessaging -attributes "[[messageEngineName messageEngine001]]"]')
AdminTask.setBinding('[-bindingLocation "" -bindingName cellWideBinding2 -policyType
WSReliableMessaging -attributes "[[busName myBus][messageEngineName messageEngine001]]"]')