2.8 MessageEndpoint

As described in Chapter 1, Spring Integration Overview, there are three implementations of the MessageEndpoint interface: SourceEndpoint, TargetEndpoint, and HandlerEndpoint. These endpoints provide the metadata necessary for the MessageBus to manage Sources, Targets, and MessageHandlers respectively.

For a SourceEndpoint, the MessageBus schedules a task for polling the Source based on the provided schedule.

When a Target or MessageHandler is registered with the MessageBus, the bus assigns it to a dispatcher that polls a MessageChannel based on the provided schedule. Targets and handlers may also provide concurrency settings in which case a thread pool will be created for asynchronous processing of messages.

Rather than programming to the API directly, it is simpler and more common to register sources, targets, and handlers with either XML or annotation-based metadata. Then, the message endpoint is an internal responsibility of the bus. The configuration options are discussed in detail in the section called “Configuring Message Endpoints”.