Examining the structure of ESB messages

A service is an implementation of a piece of business logic which exposes a well defined service contract to consumers. The service will provide an abstract service contract which describes the functionality exposed by the service and will exhibit the following characteristics:

  • Self contained: The implementation of the service is independent from the context of the consumers; any implementation changes will have no impact.
  • Loosely coupled: The consumer invokes the service indirectly, passing messages through the bus to the service endpoint. There is no direct connection between the service and its consumers.
  • Reusable: The service can be invoked by any consumer requiring the functionality exposed by the service. The provider is tied to neither a particular application nor process.

Services which adhere to these criteria will be capable of evolving and scaling without affecting any consumers of that service. The consumer no longer cares which implementation of the service is being invoked, nor where it is located, provided that the exposed service contract remains compatible.

Examining the message

The structure of the message, and how it can be manipulated, plays an important part in any ESB application as a result of the message driven nature of the communication between service providers and consumers. The message is the envelope which contains all of the information relevant to a specific invocation of a service.

All messages within JBoss ESB are implementations of the org.jboss.soa.esb.message.Message interface, the major aspects of which are:

  • Header: Information concerning the identity, routing addresses, and correlation of the message
  • Context: Contextual information pertaining to the delivery of each message, such as the security context
  • Body: The payload and additional details as required by the service contract
  • Attachment: Additional information that may be referenced from within the payload
  • Properties: Information relating to the specific delivery of a message, usually transport specific (for example the original JMS queue name)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset