Chapter 7. Tutorial on Developing Messages

7.1. Overview

Introduction
Conceptually, the message is a critical aspect of the SOA development approach. Messages contain the application-specific data sent between clients and services. The data in a message represents an important aspect of the "contract" between a service and its clients. In this section entails the best practices to use for this component.
Firstly, consider the following flight reservation service example. This service supports the following operations:
reserveSeat
This takes a flight and seat number and returns a success or failure indication.
querySeat
This takes a flight and seat number and returns an indication of whether or not the seat is currently reserved.
upgradeSeat
This takes a flight number and two seat numbers (the currently reserved seat and the one the passenger will move to).
When developing a service, you will mostly use technologies such as Enterprise Java Beans (EJB3) and Hibernate to implement the business logic. This example does not teach the reader how to implement this logic. Instead, it focuses on the service itself.
The service's role is to "plug" the logic into the bus. To configure it to do so, determine how the service is exposed to the bus (that is, the type of contract it defines for the clients). In the current version of the JBoss Enterprise Service Bus, this contract takes the form of the various messages that the clients and services exchange.

Note

Currently, there is no formal specification for this contract within the ESB. It is something the developer defines and communicates to clients irrespective of the enterprise service bus. This will be rectified in a subsequent release.