Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » QAnywhere » QAnywhere 参考 » QAnywhere 传输和删除规则 » 消息传输规则 » 服务器传输规则

 

使用传输规则文件指定服务器传输规则(不建议使用)

可以创建服务器传输规则文件并使用 QAnywhere 消息传送属性文件中的 ianywhere.qa.server.transmissionRulesFile 属性进行指定。

有关消息传递属性文件的详细信息,请参见-m 选项

要为特定客户端指定传输规则,需要在规则部分前加上带方括号的客户端消息存储库 ID。

可创建适用于所有用户的缺省服务器传输规则。

要指定缺省传输规则,使用以下行来开始一个部分:

[ianywhere.server.defaultClient]

要使新传输规则生效,必须重新启动 MobiLink 服务器。这仅适用于在传输规则文件中指定的传输规则。使用 Sybase Central 或服务器管理请求指定的服务器传输规则会立即生效。

有关服务器删除规则的信息,请参见服务器删除规则

示例

服务器传输规则文件的以下部分创建缺省规则,该缺省规则指定仅发送高优先级消息:

[ianywhere.server.defaultClient]
auto = ias_Priority > 6

在以下服务器传输规则文件的示例中,规则仅适用于由客户端消息存储库 ID sample_store_id 标识的客户端。

[sample_store_id]
; This rule governs when messages are transmitted to the client
; store with id sample_store_id.
;
;    ias_Priority >= 7
;
; Messages with priority 7 or greater should always be 
; transmitted.
;
;    ias_ContentSize < 100
;
; Small messages (messages less than 100 characters or
; bytes in size) should always be transmitted.
;
;    ias_CurrentTime < '8:00am' OR ias_CurrentTime > '6:00pm'
;
; Messages outside business hours should always be 
; transmitted

auto = ias_Priority >= 7 OR ias_ContentSize < 100 \
    OR ias_CurrentTime < datetime('8:00:00') \
    OR ias_CurrentTime > datetime('18:00:00')

在以下示例中,规则仅适用于由客户端消息存储库 ID qanywhere 标识的客户端。

[qanywhere]
; This rule governs when messages are transmitted to the client
; store with id qanywhere.
;
;    tm_Subject not like '%non-business%'
;
; Messages with the property tm_Subject set to a value that
; includes the phrase 'non-business' should not be transmitted
;
;    ias_CurrentTime < '8:00:00' OR ias_CurrentTime > '18:00:00'
;
; Messages outside business hours should always be
; transmitted

auto = tm_Subject NOT LIKE '%non-business%' \
    OR ias_CurrentTime < datetime('8:00am') OR ias_CurrentTime > datetime('6:00pm')