Event destinations and event handlers
After the event work manager generates the event XML, the message is delivered to the event handler. The event handler is responsible for publishing the message to the final external source destination.
The event manager supports the use of multiple event handlers. A default JMS event handler is installed when you install the MDM operational server. The JMS event handler publishes events to JMS queues that are configured in IBM® WebSphere® Application Server.
To use the default JMS event handler, use the event handler name
of
jms
when you add your event notification destination
and event list. The handler argument for the default handler is specified
as cfJNDI=jms/EMQCF^qJNDI=jms/EMQueue
, where:jms/EMQCF
is the JNDI name for JMS Queue Connection Factoryjms/EMQueue
is the JNDI name for JMS Queue Destination
Custom event notification handlers require the com.initiatesystems.hub.event.handler.IEventHandler interface.
This interface uses these methods:
void init()
- This method is called during initialization of the handler.void addDestination(String destName, String handlerArgs)
- When the event manager starts, it relays all destinations that are configured for event notification (in InfoSphere® MDM Workbench) to the event handler through this method. This method is called only once per event destination.int publish(String destName,String msg)
- This method is called by the event manager when an event XML is generated for a particular destination.destName
identifies the message destination (external source) andmsg
identifies the message type of XML.shutdown()
- This method is called when the event manager is shutting down.
The
int
publish method can return three values
that are based on the response from the destination. IEventHandler.EVENT_PUBLISH_SUCCESS
- if the message is received successfully by the destinationIEventHandler.EVENT_PUBLISH_ERROR_RECOVERABLE
- if the message is not received successfully and you want to attempt to resend the message according to the event manager recoverable error logicIEventHandler.EVENT_PUBLISH_ERROR_UNRECOVERABLE
- if the message is not received successfully and the message must be handled according to the event manager unrecoverable error logic