O'Reilly logo

Patterns: Implementing Self-Service in an SOA Environment by Fernando Teixeira, Shashi Shrimali, Peter Hood, Sandy Grewal, Diego Cotignola, Anup Aggarwal, Carla Sadtler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required