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 » 服务器管理请求

 

使用服务器管理请求指定传输规则

使用服务器管理请求,可以指定适用于所有用户的缺省服务器传输规则,也可以为每个客户端指定传输规则。

要(为服务器)指定缺省传输规则,请为客户端 ianywhere.server.defaultClient 设置 ianywhere.qa.server.rules 属性。对于客户端,可使用 ianywhere.qa.server.rules 属性来指定服务器传输规则。

有关如何使用服务器管理请求(包括如何对它们进行验证和调度)的概述,请参见服务器管理请求简介

示例

以下示例创建缺省规则,该规则指定仅发送高优先级消息(优先级大于 6):

<?xml version="1.0" encoding="UTF-8"?>
<actions>
  <SetProperty>
    <prop>
      <client>ianywhere.server.defaultClient</client> 
      <name>ianywhere.qa.server.rules</name>
      <value>auto = ias_Priority &gt; 6</value>
    </prop>
  </SetProperty>
  <RestartRules>
    <client>ianywhere.server.defaultClient</client>
  </RestartRules>
</actions>

以下示例为客户端 myClient 创建一个规则,该规则指定在业务时间(上午 8 时至下午 6 时)内仅传输内容大小小于 100 的消息:

<?xml version="1.0" encoding="UTF-8"?>
<actions>
  <SetProperty>
    <prop>
      <client>myClient</client> 
      <name>ianywhere.qa.server.rules</name>
      <value>auto = ias_ContentSize &lt; 100 
        or ias_CurrentTime &gt; '8:00:00' 
        or ias_CurrentTime &lt; '18:00:00'</value>
    </prop>
  </SetProperty>
  <RestartRules>
    <client>myClient</client>
  </RestartRules>
</actions>