Sun ONE Messaging Server 6.0 Administrator's Guide |
Appendix B
Administering Event Notification Service in Messaging ServerThis appendix describes what you need to do to enable the Sun ONE Event Notification Service Publisher (ENS Publisher) and administer Sun ONE Event Notification Service (ENS) in Messaging Server.
This chapter/appendix contains these sections:
For more information on ENS and ENS APIs, see the Event Service Notification Manual for Sun ONE Messaging and Collaboration at the Sun ONE Calendar Server and Messaging Server Documentation web page.
Loading the ENS Publisher in Messaging ServerThe Event Notification Service (ENS) is the underlying publish-and-subscribe service. ENS acts as a dispatcher used by Sun ONE applications as a central point of collection for certain types of events that are of interest to them. Events are changes to the value of one or more properties of a resource. Any application that wants to know when these types of events occur registers with ENS, which identifies events in order and matches notifications with subscriptions.
ENS and iBiff (the ENS publisher for Messaging Server) are bundled starting with Messaging Server. By default ENS is enabled, however, iBIFF is not loaded. (See “To Load the ENS Publisher on Messaging Server.”
In order to subscribe to notifications in Messaging Server, you need to load the libibiff file on the Messaging Server host then stop and restart the messaging server.
To Load the ENS Publisher on Messaging Server
Perform the following steps from the command line. In these steps, the location of the Messaging Server installation directory is msg_svr_base, and the Messaging Server user is inetuser. Typical values for these variables are /opt/SUNWmsgsr, and inetuser, respectively.
- As inetuser, run the configutil utility to load the libibiff file.
cd msg_svr_base
./configutil -o "local.store.notifyplugin" -v "msg_svr_base/lib/libibiff"
- As root, stop then restart the messaging server.
cd msg_svr_base/sbin
./stop-msg
./start-msg
- You are now ready to receive notifications through ENS. See "Running Sample Event Notification Service Programs"” for more information.
Running Sample Event Notification Service ProgramsMessaging Server contains sample programs to help you learn how to receive notifications. These sample programs are located in the msg_svr_base/examples directory.
To Run the Sample ENS Programs
- Change to the msg_svr_base/examples directory.
- Using a C compiler, compile the apub and asub examples using the Makefile.sample file. Set your library search path to include the msg_svr_base/examples directory.
- Once the programs have been compiled, you can run them as follows in separate windows:
apub localhost 7997
asub localhost 7997
Whatever is typed in the apub window should appear on the asub window. Also, if you use the default settings, all iBiff notifications should appear in the asub window.
- To receive notifications published by iBiff, write a program similar to asub.c
For more information on the sample programs, and writing your own programs for ENS, see the iPlanet Event Notification Service for Messaging and Collaboration Manual.
Administering Event Notification ServiceAdministering ENS consists of starting and stopping the service, and changing the configuration parameters to control the behavior of the iBiff publisher for ENS.
Starting and Stopping ENS
You use the start-msg ens and stop-message ens commands to start and stop the ENS server. You must be root to run these commands.
To Start and Stop ENS
iPlanet Event Notification Service Configuration Parameters
Several configuration parameters control the behavior of iBiff. Use the configutil utility program to set these parameters.