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 通告程序由 MobiLink 安装脚本创建,并在使用 -m 选项运行 MobiLink 服务器时启动。QAnywhere 通告程序称为 QAnyNotifier_client。

QAnyNotifier_client 使用用于服务器启动的同步的 MobiLink 服务器设置中介绍的缺省设置,但以下设置除外:

  • gui 属性设置为 off,这意味着在运行通告程序的计算机上不显示 [通告程序] 窗口。

  • enable 属性设置为 no,这意味着必须使用 -m 选项运行 mlsrv11,进而启动通告程序。

  • poll_every 属性设置为 5,这意味着通告程序每五秒轮询一次,以查看是否需要发送推式通知。

可以更改以下通告程序属性:

  • poll_every 属性

  • request_cursor 属性中的 resend interval

  • request_cursor 属性中的 time to live

注意

除上述列出的三个属性之外,不要更改任何通告程序属性。不要更改 request_cursor 中的任何其它列。

Poll_every 属性

通过更改以下代码中的值 5,然后针对您的统一数据库运行该代码,可以更改 QAnyNotifier_client 的缺省轮询间隔:

CALL ml_add_property( 'SIS', 'Notifier(QAnyNotifier_client)', 'poll_every', '5' )

请参见通告程序属性

Resend interval 和 time to live

QAnywhere 通告程序包含缺省 request_cursor。request_cursor 确定在推送请求中发送哪些信息、接收信息的对象、时间以及地点。除 resend interval 和 time to live 之外,不要更改任何缺省设置。resend interval 指定未接收到的推式通知缺省情况下每 5 分钟重新发送一次。time to live 指定未接收到的推式通知在缺省情况下重新发送 3 小时。大多数情况下,这些缺省设置是最佳的。以下是随 QAnNotifier_client 提供的缺省 request_cursor:

SELECT 
    u.user_id, 
    'Default-DeviceTracker', 
    'qa', 
    u.name, 
    u.name, 
    '5M', 
    '3H' 
    FROM ml_qa_notifications u 
    WHERE EXISTS(SELECT * 
        FROM ml_listening l 
        WHERE l.name = u.name AND l.listening = 'y')

有关 request_cursor 中列的详细信息,请参见推式请求要求

通过更改以下代码中的值 5M,可以将 resend interval 从缺省值 5 分钟更改为其它值。同样,通过更改值 3H 可以更改 time to live 的缺省值 3 小时。

CALL ml_add_property( 
  'SIS',
  'Notifier(QAnyNotifier_client)',
  'request_cursor',
  'select u.user_id,
  ''Default-DeviceTracker'',
  ''qa'',
  u.name,
  u.name,
  ''5M'',
  ''3H''
     FROM ml_qa_notifications u 
     WHERE EXISTS( 
        SELECT * 
         FROM ml_listening l WHERE l.name = u.name AND l.listening = ''y'')' )

有关详细信息,请参见request_cursor 事件

另请参见