When MessageHandlers
are registered with the MessageBus
,
the bus assigns the handler to a dispatcher based on the provided schedule as described above. Internally, the
bus is creating and registering an instance that implements the MessageEndpoint
interface. This is where other handler metadata enters the picture (e.g. the concurrency settings). Basically,
you can consider the endpoint to be a composite handler built from a simple implementation of the
MessageHandler
along with its metadata. In fact, the
MessageEndpoint
does extend the MessageHandler
interface.
public interface MessageEndpoint extends MessageHandler { String getName(); Subscription getSubscription(); ConcurrencyPolicy getConcurrencyPolicy(); }
When using the API, it's simpler to register handlers with metadata and leave the message endpoint as an internal
responsibility of the bus. However, it is possible to create endpoints directly. Spring Integration provides a
single implementation: DefaultMessageEndpoint
.