Sun Java System Messaging Server 6.3 管理指南

Procedure配置 JMQ 通知插件

在这一过程中,您首先配置要生成通知的邮件事件。接下来,指定 Message Queue 需要的信息。最后(步骤 9),通过在插件库名称后指定一个参数来配置插件名称:


'/opt/SUNWmsgsr/lib/libjmqnotify$plug-in_name'

如果没有指定插件名称,则默认使用 jmqnotify

开始之前

您应该安装、配置和部署以下产品:


注 –

以下步骤中将要配置的大部分 configutil 参数是可选的。有关参数默认值列表,请参见表 22–2


  1. 配置通知邮件参数。

    对于每一种想要包含在插件内的通知邮件,请结合使用 local.store.notifyplugin 命令和 configutil 实用程序。

    例如,要为新邮件启用通知,输入:


    configutil -o local.store.notifyplugin.jmqnotify.NewMsg.enable -v 1

    其中 jmqnotify 是插件的名称

    -v 1 为此邮件启用通知。值为 0 将禁用对此邮件的通知。

    有关所有 JMQ 通知邮件的列表,请参见22.3.1 通知邮件

    有关启用 JMQ 通知邮件的 configutil 参数的定义,请参见 Sun Java System Messaging Server Administration Reference 中的第 3 章 "Messaging Server Configuration"。

    有些通知邮件使用多个 configutil 参数启用具有附加功能的邮件。例如,有些邮件可以在通知文本中包含邮件标题。有关如何配置这些邮件的说明,请参见newflags 和 oldflags 属性的语法


    注 –

    您必须为每个配置的插件单独配置参数。

    因此,如果配置两个插件(名为 jmq1jmq2),并且希望为两个插件启用新邮件通知,则必须运行 local.store.notifyplugin 命令两次:


    configutil -o local.store.notifyplugin.jmq1.NewMsg.enable -v 1

    configutil -o local.store.notifyplugin.jmq2.NewMsg.enable -v 1

  2. 指定运行 Message Queue 目标(代理)的主机。

    例如,输入以下命令:


    configutil -o local.store.notifyplugin.jmqnotify.jmqHost -v "127.0.0.1"

    其中 jmqnotify 是插件的名称

    "127.0.0.1" 是 Message Queue 代理主机的 IP 地址。

  3. 指定 Message Queue 代理的端口。

    例如,输入以下命令:


    configutil -o local.store.notifyplugin.jmqnotify.jmqPort -v "7676"

    其中 jmqnotify 是插件的名称

    "7676" 是为 Message Queue 代理指定的端口。

  4. 指定授权为服务生成邮件的 Message Queue 用户的用户 ID 和密码。

    例如,输入以下命令:


    configutil -o local.store.notifyplugin.jmqnotify.jmqUser -v "guest"

    configutil -o local.store.notifyplugin.jmqnotify.jmqPwd -v "%$#a62t&"

    其中 jmqnotify 是插件的名称

    "guest""%$#a62t&" 分别是 Message Queue 用户的用户 ID 和密码。

  5. 配置目的地(主题或队列)类型和邮件将要发送到的目的地的名称。

    按以下步骤操作:

    1. 指定目标是主题还是队列。

      例如,输入以下命令:


      configutil -o local.store.notifyplugin.jmqnotify.DestinationType -v "queue"

      其中 jmqnotify 是插件的名称

      "queue" 指定目标是一个队列。此参数允许的值是 "queue""topic"

    2. 指定目标名称。

      例如,输入以下命令之一:


      configutil -o local.store.notifyplugin.jmqnotify.jmqQueue -v "JES-MS"


      configutil -o local.store.notifyplugin.jmqnotify.jmqTopic -v "JES-MS"

      其中 jmqnotify 是插件的名称

      jmqQueuejmqTopic 标识目标类型。jmqQueuejmqTopic 参数是同义的并且相互排斥;在一个插件中只能使用这两个参数中的一个。

      "JES-MS" 是邮件将要发送到的队列或主题的示例名。

  6. 指定邮件优先级。

    例如,输入以下命令:


    configutil -o local.store.notifyplugin.jmqnotify.Priority -v 3

    其中 jmqnotify 是插件的名称

    -v 3 是指定给此插件生成的邮件的 Message Queue 优先级。

    Priority 的默认值为 4。

  7. 指定 Message Queue 代理保留邮件的时间长度(以毫秒为单位)。

    例如,输入以下命令:


    configutil -o local.store.notifyplugin.jmqnotify.ttl -v 100

    其中 jmqnotify 是插件的名称

    -v 100 指定在发送或放弃某个邮件之前,Message Queue 服务保留邮件 100 毫秒。值为 0 表示邮件永久被保留;不会超时。

  8. 指定邮件持久性。

    例如,输入以下命令:


    configutil -o local.store.notifyplugin.jmqnotify.Persistent -v 1

    其中 jmqnotify 是插件的名称

    -v 1 指定在 Message Queue 服务中使用持久性邮件。允许的值为 1(持久)和 0(非持久)。

  9. 配置插件名称。

    要配置具有默认名称的单个插件,可以输入插件库的全限定名称或者库名称及其插件参数:


    configutil -o local.store.notifyplugin -v /opt/SUNWmsgsr/lib/libjmqnotify


    configutil -o local.store.notifyplugin -v '/opt/SUNWmsgsr/lib/libjmqnotify$jmqnotify'

    其中 libjmqnotify 是库名称,

    jmqnotify 是插件参数的默认名称。

    使用美元符号 ($) 分隔库名称和参数。

    将整个值用单引号引起来('');否则 shell 将解释美元符号。

    默认插件读取的 configutil 参数有以下名称:


    local.store.notifyplugin.jmqnotify.*

    要配置其他插件名称(如 jmq42),请输入以下命令:


    configutil -o local.store.notifyplugin -v '/opt/SUNWmsgsr/lib/libjmqnotify$jmq42'

    jmq42 插件读取的 configutil 参数有以下名称:


    local.store.notifyplugin.jmq42.*