Mediation programming
Use the capabilities of the mediation infrastructure, we can program mediations to customize the way that a service integration bus handles messages. You develop the mediation code within a component called a mediation handler, and add the mediation handler to a handler list, which is an application that is ready to deploy and install. We can connect a number of mediation handlers together in a mediation handler list to create a set of operations to run on a message.
A mediation handler is a Java program framework to which we add the code that operates on a message to perform the mediation function. For example, we can program mediations to process messages in any of the following ways:
- Reformat messages from the format produced by one application to the format required by another
- Route messages based on message content
- Distribute messages to more than one destination
- Augment messages by adding information to a message from another data source
- Transcode messages from one concrete representation to another
The following programming APIs are available for working with messages when you program a mediation:
- MediationHandler API
- A mediation handler must implement the MediationHandler interface. This interface defines the method that is invoked by the mediation runtime environment.
- SIMessage and SIMessageContext APIs
- These APIs allow the mediation to operate on the contents of the message.
- SIMediationSession API
- This API gives the mediation access to a service integration bus so that the mediation can send and receive messages.
We create a handler list by using an assembly tool, for example IBM Rational Application Developer, before deploying the mediation handler application as an Enterprise Archive (EAR file).
A handler list can contain one or many mediation handlers. At run time, each mediation handler in the list is invoked in sequence. Each time a handler returns a value of True, the same message context is passed to the next handler. If a handler returns the value False, then the context is not passed to the next handler. The message is discarded, and is not delivered to its target destination.
Subtopics
- SDO data graphs
Service Data Objects (SDO) is an open standard for enabling applications to handle data from different data sources in a uniform way, as data graphs. SDO data graphs are an important concept for mediation programmers because we can use them to represent different types of message information in a standard way, giving a simple and powerful model for programming mediations.
- Coding tips for mediations programming
Programming hints to help when we are writing mediation code.
Related tasks
Writing a mediation handler
MediationHandler SIMessageContext SIMessage SIMediationSession
Related information:
IBM Rational Application Developer documentation