Chapter 10. Web services scenario 323
10.6 Creating the mediations
Mediations are implemented as mediation handlers. A mediation handler can be
deployed, and each mediation handler executes some specific message
processing at runtime (for example, transforming a message format or routing a
message to a particular destination). A
mediation handler is a Java program
framework to which you add the code that performs the mediation function.
This section illustrates creation of two mediation applications:
1. A router mediation will receive messages at the destination created for the
HomeDelivery outbound service. It will check the delivery type parameter
send by client (Home, Business, or All) and based on the value it will send the
message to the HomeDelivery outbound service, the BusinessDelivery
outbound service or to both. If All is selected, the reverse routing path is
changed to a queue that will be mediated with the aggregator mediation.
2. A mediation will aggregate responses from multiple services into one
response. This situation will occur when a user elects to get both a home and
a business account (All). This mediation will be attached to a queue
destination that receives the responses from both the BusinessDelivery and
HomeDelivery services.
Figure 10-28 Mediation flow
HomeDelivery EJB
BusinessDelivery EJB
HomeDelivery EJB
HomeDelivery EJB
DeliverySystem EAR
HomeDelivery EJB
ClientDelivery EJB
HomeDelivery EJB
HomeDelivery Proxy
Processor.ear
HomeDelivery EJB
RoutingMediationsEJB
HomeDelivery EJB
Aggregator EJB
Service ingration bus
HomeDelivery
Inbound service
BusinessDelivery
outbound service
HomeDelivery
outbound service
If type="All"
If type="Home"
If type="Business"
If type="All"
DeliveryReponseDestination
DeliveryRequestMediation
DeliveryReponseMediation
TempDestination

Get Patterns: Implementing Self-Service in an SOA Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.