Catalog Function Implementation for Custom Channel

Your channel code must implement certain methods to provide proper semantics to the Event catalog functions.

Event.send

Override the Destination.send method and provide implementation to send to your destination endpoint. This method is invoked when the BusinessEvents application code invokes Event.send.

Event.requestEvent

Override your Destination.requestEvent method and provide an implementation to synchronously send a message request to your destination endpoint. The implementation should return a response event to the caller. If your messaging system do not support the request-reply semantic, you can choose to throw an unsupported operation exception.

Event.routeTo

Override your Destination.send and provide implementation to route to your specified destination endpoint.

EventContext

An EventContext object holds the context of the incoming event. Your Destination.getEventContext method must return an implementation of your EventContext. In your event context, you can keep any state, such as, the inbound message received in your listener callback; corresponding listener/session handles, and so on. Typically you would keep as much state in this object as required for providing proper behavior for the EventContext.reply and EventContext.acknowledge methods.

Event.replyTo

This catalog function maps to the EventContext.reply method. Override the EventContext.reply method as applicable for your project for a reply event semantics.

Event.consumeEvent

This catalog function maps to your EventContext.acknowledge method. For some messaging systems, you might need to indicate to your message broker to acknowledge delivery of the inbound message, so that the message is not redelivered. Override the EventContext.acknowledge method as applicable for your project.