Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Messaging Server 6 2005Q1 Administration Guide 

Appendix B
Administering Event Notification Service in Messaging Server

This appendix describes what you need to do to enable the Event Notification Service Publisher (ENS Publisher) and administer 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 Java System Communications Services at the Sun Java System Calendar Server at and Messaging Server Documentation web page at

Loading the ENS Publisher in Messaging Server

The Event Notification Service (ENS) is the underlying publish-and-subscribe service. ENS acts as a dispatcher used by Sun Java System 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.

  1. As inetuser, run the configutil utility to load the libibiff file.
  2. cd msg_svr_base

                       ./configutil -o "" -v "msg_svr_base/lib/libibiff"

  3. As root, stop then restart the messaging server.
  4. cd msg_svr_base/sbin



  5. You are now ready to receive notifications through ENS. See Running Sample Event Notification Service Programs” for more information.

Running Sample Event Notification Service Programs

Messaging 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

  1. Change to the msg_svr_base/examples directory.
  2. 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.
  3. Once the programs have been compiled, you can run them as follows in separate windows:
  4. 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.

  5. To receive notifications published by iBiff, write a program similar to asub.c
  6. 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.


    Once you set your library search path to include the msg_svr_base/lib directory, you can no longer stop and start the directory server. The workaround is to remove the entry from the library search path.

Administering Event Notification Service

Administering 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.

Table B-1  iBiff Configuration Parameters  



Specifies the maximum size (in bytes) of the header that will be transmitted with the notification. The default is 0 bytes.

Specifies the maximum size (in bytes) of the body that will be transmitted with the notification. The default is 0 bytes.

Specifies if the given event type will generate a notification. See the Messaging Server for Messaging and Collaboration Manual for the various eventTypes such as ReadMsg, NewMsg, and so on. The legal values are 1 (to enable) and 0 (to disable). The default value is 1; that is, setting to 0 will disable ReadMsg notifications.

Specifies the hostname of the ENS server. The default is

Specifies the TCP port of the ENS server. The default is 7997.

Specifies the event key to use for ENS notifications. The default is enp:// The hostname portion of the event key is not used to determine the ENS host. It is simply a unique identifier used by ENS.

This key is what the subscriber should subscribe to in order to be notified of events matching this key.

Previous      Contents      Index      Next     

Copyright 2005 Sun Microsystems, Inc. All rights reserved.