协议网桥属性文件格式
代理配置目录中的 ProtocolBridgeProperties.xml 文件定义协议文件服务器的属性。
ProtocolBridgeProperties.xml 文件必须符合 ProtocolBridgeProperties.xsd 模式。 ProtocolBridgeProperties.xsd 模式文档位于 Managed File Transfer 安装的 MQ_INSTALLATION_PATH/mqft/samples/schema 目录中。 模板文件 ProtocolBridgeProperties.xml 通过 fteCreateBridgeAgent 命令创建在代理配置目录中。
ProtocolBridgeProperties.xml 文件由代理定期重新装入,并且对该文件所做的任何有效更改都将影响代理的行为。 缺省重新装入时间间隔为 30 秒。 可以通过在 agent.properties 文件中指定代理属性 xmlConfigReloadInterval 来更改此时间间隔。
模式
以下模式描述 ProtocolBridgeProperties.xml 文件。
如果不使用以下属性:- maxActiveDestinationTransfers (全球属性)
- maxActiveDestinationTransfers (独立服务器属性)
- failTransferWhenCapacityReached
注意: 要使用附加属性,源协议桥代理和目的协议桥代理都必须是 IBM® MQ 9.2.1 或更高版本。
请参阅 对序列组的更改, 对限制组的更改 ,以了解这些属性对模式进行的更改,以及 限制到各个文件服务器的文件传输次数的方案和示例 ,以获取有关这些更改如何影响协议网桥代理工作的信息。
注意: IBM WebSphere® MQ 7.5, 或 IBM WebSphere MQ File Transfer Edition 7.0.2, 或更高版本不支持 maxReconnectRetry 和 reconnectWaitPeriod 属性。
<schema targetNamespace="http://wmqfte.ibm.com/ProtocolBridgeProperties" elementFormDefault="qualified"
xmlns="https://www.w3.org/2001/XMLSchema" xmlns:tns="http://wmqfte.ibm.com/ProtocolBridgeProperties">
<!--
Example: ProtocolBridgeProperties.xml
<?xml version="1.0" encoding="UTF-8"?>
<tns:serverProperties xmlns:tns="http://wmqfte.ibm.com/ProtocolBridgeProperties"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wmqfte.ibm.com/ProtocolBridgeProperties
ProtocolBridgeProperties.xsd">
<tns:credentialsFile path="$HOME/ProtocolBridgeCredentials.xml" />
<tns:defaultServer name="myserver" />
<tns:ftpServer name="myserver" host="myhost.hursley.ibm.com" port="1234" platform="windows"
timeZone="Europe/London" locale="en-GB" fileEncoding="UTF-8"
listFormat="unix" limitedWrite="false" />
<tns:sftpServer name="server1" host="myhost.hursley.ibm.com" platform="windows"
fileEncoding="UTF-8" limitedWrite="false">
<limits maxListFileNames="10" />
</tns:sftpServer>
</tns:serverProperties>
-->
<!-- Root element for the document -->
<element name="serverProperties" type="tns:serverPropertiesType"></element>
<!--
A container for all protocol bridge server properties
-->
<complexType name="serverPropertiesType">
<sequence>
<element name="credentialsFile" type="tns:credentialsFileName" minOccurs="0" maxOccurs="1" />
<element name="defaultServer" type="tns:serverName" minOccurs="0" maxOccurs="1" />
<choice minOccurs="0" maxOccurs="unbounded">
<element name="ftpServer" type="tns:ftpServerType" />
<element name="sftpServer" type="tns:sftpServerType" />
<element name="ftpsServer" type="tns:ftpsServerType" />
<element name="ftpsfgServer" type="tns:ftpsfgServerType" />
<element name="ftpssfgServer" type="tns:ftpssfgServerType" />
</choice>
</sequence>
</complexType>
<!--
A container for a server name
-->
<complexType name="serverName">
<attribute name="name" type="tns:serverNameType" use="required" />
</complexType>
<!--
A container for a credentials file name
-->
<complexType name="credentialsFileName">
<attribute name="path" type="string" use="required" />
</complexType>
<!--
A container for all the information about an FTP server
-->
<complexType name="ftpServerType">
<sequence>
<element name="limits" type="tns:generalLimitsType" minOccurs="0" maxOccurs="1" />
</sequence>
<attributeGroup ref="tns:ftpServerAttributes"/>
<attribute name="passiveMode" type="boolean" use="optional" />
</complexType>
<!--
A container for all the information about an SFG FTP server
-->
<complexType name="ftpsfgServerType">
<sequence>
<element name="limits" type="tns:generalLimitsType" minOccurs="0" maxOccurs="1" />
</sequence>
<attributeGroup ref="tns:ftpServerAttributes"/>
</complexType>
<!--
A container for all the information about an SFTP server
-->
<complexType name="sftpServerType">
<sequence>
<element name="limits" type="tns:sftpLimitsType" minOccurs="0" maxOccurs="1" />
</sequence>
<attributeGroup ref="tns:sftpServerAttributes"/>
</complexType>
<!--
A container for all the information about a FTPS server
-->
<complexType name="ftpsServerType">
<sequence>
<element name="limits" type="tns:generalLimitsType" minOccurs="0" maxOccurs="1" />
</sequence>
<attributeGroup ref="tns:ftpsServerAttributes"/>
</complexType>
<!--
A container for all the information about a SFG FTPS server
-->
<complexType name="ftpssfgServerType">
<sequence>
<element name="limits" type="tns:generalLimitsType" minOccurs="0" maxOccurs="1" />
</sequence>
<attributeGroup ref="tns:ftpsServerAttributes"/>
</complexType>
<!--
Attributes common to all server types
-->
<attributeGroup name="generalServerAttributes">
<attribute name="name" type="tns:serverNameType" use="required" />
<attribute name="host" type="string" use="required" />
<attribute name="port" type="nonNegativeInteger" use="optional" />
<attribute name="platform" type="tns:platformType" use="required" />
<attribute name="fileEncoding" type="string" use="required" />
<attribute name="limitedWrite" type="boolean" use="optional" />
<attribute name="controlEncoding" type="string" use="optional" />
</attributeGroup>
<!--
Attributes common to ftp and ftps server types
-->
<attributeGroup name="ftpServerAttributes">
<attributeGroup ref="tns:generalServerAttributes"/>
<attribute name="timeZone" type="string" use="required" />
<attribute name="locale" type="tns:localeType" use="required" />
<attribute name="listFormat" type="tns:listFormatType" use="optional" />
<attribute name="listFileRecentDateFormat" type="tns:dateFormatType" use="optional" />
<attribute name="listFileOldDateFormat" type="tns:dateFormatType" use="optional" />
<attribute name="monthShortNames" type="tns:monthShortNamesType" use="optional" />
</attributeGroup>
<!--
Attributes common to ftps server types
-->
<attributeGroup name="ftpsServerAttributes">
<attributeGroup ref="tns:ftpServerAttributes"/>
<attribute name="ftpsType" type="tns:ftpsTypeType" use="optional" />
<attribute name="trustStore" type="string" use="required" />
<attribute name="trustStoreType" type="string" use="optional" />
<attribute name="keyStore" type="string" use="optional" />
<attribute name="keyStoreType" type="string" use="optional" />
<attribute name="ccc" type="boolean" use="optional" />
<attribute name="protFirst" type="boolean" use="optional" />
<attribute name="auth" type="string" use="optional" />
<attribute name="connectTimeout" type="nonNegativeInteger" use="optional"/>
</attributeGroup>
<!--
A container for limit-type attributes for a server. Limit parameters
are optional, and if not specified a system default will be used.
-->
<complexType name="generalLimitsType">
<attributeGroup ref="tns:generalLimitAttributes"/>
</complexType>
<complexType name="sftpLimitsType">
<attributeGroup ref="tns:generalLimitAttributes"/>
<attribute name="connectionTimeout" type="nonNegativeInteger" use="optional" />
</complexType>
<!--
Attributes for limits common to all server types
-->
<attributeGroup name="generalLimitAttributes">
<attribute name="maxListFileNames" type="positiveInteger" use="optional" />
<attribute name="maxListDirectoryLevels" type="nonNegativeInteger" use="optional" />
<attribute name="maxReconnectRetry" type="nonNegativeInteger" use="optional" />
<attribute name="reconnectWaitPeriod" type="nonNegativeInteger" use="optional" />
<attribute name="maxSessions" type="positiveInteger" use="optional" />
<attribute name="socketTimeout" type="nonNegativeInteger" use="optional" />
</attributeGroup>
<!--
The type for matching valid server names. Server names must be at least 2 characters in length and
are limited to alphanumeric characters and the following characters: ".", "_", "/" and "%".
-->
<simpleType name="serverNameType">
<restriction base="string">
<pattern value="[0-9a-zA-Z\._/%]{2,}"/>
</restriction>
</simpleType>
<!--
The types of platform supported.
-->
<simpleType name="platformType">
<restriction base="string">
</restriction>
</simpleType>
<!--
The type for matching a locale specification.
-->
<simpleType name="localeType">
<restriction base="string">
<pattern value="(..)[-_](..)"/>
</restriction>
</simpleType>
<!--
The types of list format supported (for FTP servers).
-->
<simpleType name="listFormatType">
<restriction base="string">
</restriction>
</simpleType>
<!--
Date format for FTP client directory listing on an FTP server. This is
the format to be passed to methods setDefaultDateFormatStr and
setRecentDateFormatStr for Java class:
org.apache.commons.net.ftp.FTPClientConfig
-->
<simpleType name="dateFormatType">
<restriction base="string">
</restriction>
</simpleType>
<!--
A list of language-defined short month names can be specified. These are
used for translating the directory listing received from the FTP server.
The format is a string of three character month names separated by "|"
-->
<simpleType name="monthShortNamesType">
<restriction base="string">
<pattern value="(...\|){11}(...)"/>
</restriction>
</simpleType>
<!--
The enumerations of the allowed FTPS types: "implicit" & "explicit"
If not specified the default is "explicit"
-->
<simpleType name="ftpsTypeType">
<restriction base="string">
<enumeration value="explicit"/>
<enumeration value="implicit"/>
</restriction>
</simpleType>
<!--
Attribute Group for SFTP Servers
-->
<attributeGroup name="sftpServerAttributes">
<attributeGroup ref="tns:generalServerAttributes"/>
<attribute name="cipherList" type="string" use="optional" />
</attributeGroup>
</schema>
![[MQ 9.2.1 2020 年 12 月]](../ng921.gif)
对 sequence 组的更改
在添加 maxActiveDestinationTransfers (全局) 和 failTransferWhenCapacityReached 属性之后,
ComplexType 下的 sequence 组如下所示,更改以粗体文本显示:
<!--
A container for all protocol bridge server properties
-->
<complexType name="serverPropertiesType">
<sequence>
<element name="credentialsFile" type="tns:credentialsFileName" minOccurs="0" maxOccurs="1" />
<element name="credentialsKeyFile" type="tns:credentialsKeyFileName" minOccurs="0" maxOccurs="1" />
<element name="maxActiveDestinationTransfers"
type="tns:maxActiveDestinationTransfersValue" minOccurs="0"
maxOccurs="1" />
<element name="failTransferWhenCapacityReached"
type="tns:failTransferWhenCapacityReachedValue" minOccurs="0"
maxOccurs="1" />
<element name="defaultServer" type="tns:serverName" minOccurs="0" maxOccurs="1" />
<choice minOccurs="0" maxOccurs="unbounded">
<element name="ftpServer" type="tns:ftpServerType" />
<element name="sftpServer" type="tns:sftpServerType" />
<element name="ftpsServer" type="tns:ftpsServerType" />
<element name="ftpsfgServer" type="tns:ftpsfgServerType" />
<element name="ftpssfgServer" type="tns:ftpssfgServerType" />
</choice>
</sequence>
</complexType>
<!--
A container for default value for maxActiveDestinationTransfers
-->
<complexType name="maxActiveDestinationTransfersValue">
<attribute name="value" type="positiveInteger" use="required" />
</complexType>
<!--
A container for a boolean value to decide to fail a transfer if max capacity is reached
-->
<complexType name="failTransferWhenCapacityReachedValue">
<attribute name="value" type="boolean" use="required" />
</complexType>
![[MQ 9.2.1 2020 年 12 月]](../ng921.gif)
对 limits 组的更改
在添加 maxActiveDestinationTransfers (个别服务器) 属性之后,
limits 组如下所示,并以粗体文本显示更改:
<!--
Attributes for limits common to all server types
-->
<attributeGroup name="generalLimitAttributes">
<attribute name="maxListFileNames" type="positiveInteger"
use="optional"/>
<attribute name="maxListDirectoryLevels" type="nonNegativeInteger"
use="optional"/>
<attribute name="maxReconnectRetry" type="nonNegativeInteger"
use="optional" />
<attribute name="reconnectWaitPeriod" type="nonNegativeInteger"
use="optional" />
<attribute name="maxSessions" type="positiveInteger" use="optional" />
<attribute name="socketTimeout" type="nonNegativeInteger" use="optional"
/>
<attribute name="connectionTimeout" type="nonNegativeInteger"
use="optional" />
<attribute name="maxActiveDestinationTransfers" type="nonNegativeInteger"
use="optional" />
</attributeGroup>
![[MQ 9.2.1 2020 年 12 月]](../ng921.gif)
示例 XML 文件
<tns:serverProperties
xmlns:tns="http://wmqfte.ibm.com/ProtocolBridgeProperties"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wmqfte.ibm.com/ProtocolBridgeProperties
ProtocolBridgeProperties.xsd">
<tns:maxActiveDestinationTransfers value="5" />
<tns:failTransferWhenCapacityReached value="true"/>
<tns:defaultServer name="guestServer" />
<tns:sftpServer name="guestServer" host="9.202.177.44" port="22"
platform="unix" fileEncoding="UTF-8" limitedWrite="false">
<tns:limits connectionTimeout="60"
maxActiveDestinationTransfers="2"/>
</tns:sftpServer>
<tns:sftpServer name="nixonServer" host="9.199.145.33" port="22"
platform="unix" fileEncoding="UTF-8" limitedWrite="false">
<tns:limits connectionTimeout="60"/>
</tns:sftpServer>
<tns:sftpServer name="mySFTPserver" host="Harrison.hursley.ibm.com"
port="22" platform="unix" fileEncoding="UTF-8 limitedWrite="false"
>
<tns:limits connectionTimeout="60" />
</tns:sftpServer>
</tns:serverProperties>
了解 ProtocolBridgeProperties.xml 文件
以下列表中描述了 ProtocolBridgeProperties.xml 文件中使用的元素和属性:- <serverProperties>
- XML 文档的根元素
- <credentialsFile>
- 包含凭证的文件的路径。 对于 IBM WebSphere MQ 7.5 或更高版本,该属性的值可以包含环境变量。 更多信息,请参阅 MFT 属性中的环境变量
- <defaultServer>
- 充当文件传输的缺省服务器的协议文件服务器
- <ftpServer>
- FTP 文件服务器
- <sftpServer>
- SFTP 文件服务器
- <ftpsServer>
- FTPS 文件服务器
- 适用于所有类型的协议文件服务器的一般服务器属性:
属性 描述 名称 必需。 协议文件服务器的名称。 协议服务器名称长度必须至少为两个字符,不区分大小写,且局限于字母数字字符和以下字符: - 句点 (.)
- 下划线 (_)
- 正斜杠 (/)
- 百分号 (%)
主机 必需。 要向其发送文件或接收其文件的协议文件服务器的主机名或 IP 地址。 port 可选。 要向其发送文件或接收其文件的协议文件服务器的端口号。 platform 必需。 要向其发送文件或接收其文件的协议文件服务器的平台。 指定 UNIX 或 WINDOWS。根据您在 FTP、FTPS 或 SFTP 服务器上输入路径的方法,设置该属性。 例如,如果要在 Windows 上运行 FTP 服务器,但在登录到服务器时,必须输入 UNIX样式的路径 (即带有正斜杠) ,请将此值设置为 UNIX 而不是 WINDOWS。 在 Windows 上运行的服务器通常提供 UNIX样式的文件系统。 fileEncoding 必需。 定义文件服务器使用的字符编码。 当您以文本方式传输文件时,使用该属性,以便在平台之间移动文件时更改正确的编码序列。 例如,UTF-8。 limitedWrite 可选。 写入文件服务器时的缺省方式是创建临时文件,然后在完成传输后重命名该文件。 对于配置为只写的文件服务器,会使用其最终名称直接创建此文件。 该属性的值可以为 true 或 false。 缺省值为 false。 controlEncoding 可选。 正发送给协议文件服务器的控制消息的控制编码值。 该属性影响使用的文件名称的编码,并且必须与协议文件服务器的控制编码兼容。 缺省值为 UTF-8。