在此程序中,請先配置將產生通知的郵件事件。接著指定郵件佇列所需的資訊。最後 (在步驟 9 中),請在外掛程式程式庫的名稱之後指定參數,以配置外掛程式名稱:
'/opt/SUNWmsgsr/lib/libjmqnotify$plug-in_name' |
如果未指定外掛程式名稱,預設會使用 jmqnotify。
應安裝、配置及部署以下產品:
Sun Java System Messaging Server
Sun Java System 郵件佇列 3.6 SP3 2005Q4 或更新版本
將在以下步驟配置的大部分 configutil 參數,均為選擇性參數。如需這些參數的預設值清單,請參閱表 22–2。
配置通知郵件參數。
針對您想納入外掛程式的每種通知郵件,搭配 configutil 公用程式使用 local.store.notifyplugin 指令。
例如,若要啟用新郵件的通知,請輸入:
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」中的「Chapter 3: Messaging Server Configuration」。
部分通知郵件使用多個 configutil 參數啟用郵件的其他功能。例如,部分郵件可在通知文字中帶有郵件標頭。如需有關如何配置這些郵件的說明,請參閱newflags 和 oldflags 特性的語法。
您必須分別為每個配置的外掛程式配置參數。
因此,如果您配置兩個名為 jmq1 和 jmq2 的外掛程式,並要為這兩個外掛程式啟用新郵件通知,必須執行 local.store.notifyplugin 指令兩次:
configutil -o local.store.notifyplugin.jmq1.NewMsg.enable -v 1 |
configutil -o local.store.notifyplugin.jmq2.NewMsg.enable -v 1 |
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.jmqHost -v "127.0.0.1" |
其中 jmqnotify 是外掛程式的名稱,
而 "127.0.0.1" 是郵件佇列代理程式的主機電腦 IP 位址。
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.jmqPort -v "7676" |
其中 jmqnotify 是外掛程式的名稱,
而 "7676" 是郵件佇列代理程式的連接埠。
指定授權產生郵件至服務的郵件佇列使用者之使用者 ID 和密碼。
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.jmqUser -v "guest" |
configutil -o local.store.notifyplugin.jmqnotify.jmqPwd -v "%$#a62t&" |
其中 jmqnotify 是外掛程式的名稱,
而 "guest" 和 "%$#a62t&" 分別是郵件佇列使用者的使用者 ID 和密碼。
請按照以下步驟:
指定目標是主題或佇列。
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.DestinationType -v "queue" |
其中 jmqnotify 是外掛程式的名稱,
而 "queue" 會指定目標為佇列。此參數允許的值為 "queue" 和 "topic"。
指定目標名稱。
例如,輸入以下其中一個指令:
configutil -o local.store.notifyplugin.jmqnotify.jmqQueue -v "JES-MS" |
或
configutil -o local.store.notifyplugin.jmqnotify.jmqTopic -v "JES-MS" |
其中 jmqnotify 是外掛程式的名稱,
jmqQueue 或 jmqTopic 識別目標類型。jmqQueue 和 jmqTopic 參數性質相同但彼此互異;您僅能在一個外掛程式中使用其中一種參數。
"JES-MS" 是郵件將傳送至的佇列或主題範例名稱。
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.Priority -v 3 |
其中 jmqnotify 是外掛程式的名稱,
而 -v 3 是指定給此外掛程式所產生之郵件的郵件佇列優先順序。
Priority 的預設值為 4。
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.ttl -v 100 |
其中 jmqnotify 是外掛程式的名稱,
而 -v 100 指定郵件佇列服務保留郵件 100 毫秒,再進行遞送或捨棄。值 0 表示會永久保留郵件;郵件不會逾時。
例如,輸入以下指令:
configutil -o local.store.notifyplugin.jmqnotify.Persistent -v 1 |
其中 jmqnotify 是外掛程式的名稱,
而 -v 1 指定郵件佇列服務中使用的郵件為永久性。允許的值為 1 (永久性) 和 0 (非永久性)。
若要使用預設名稱配置單一外掛程式,您可以輸入外掛程式程式庫之完全合格的名稱,或程式庫的名稱及其外掛程式參數:
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.* |