For the Curious: Endpoint API
Now that you have seen the basic types of consumers, you should understand where they are really used. Under normal circumstances, you do not have to use them, as you will be configuring them under an XML namespace. The framework provides these components under various namespaces, so you can add the respective elements declaratively straight out of the box. This reduces the amount of coding and encourages a declarative programming model.
But for now, keep in mind that Transformers, Filters, Routers, etc.,
are all supported by the spring XML namespace. This
means you can declaratively create an instance of any of these flow
components. For example, a transformer
element is used to create a Transformer component which
will fetch messages from the input channel to kick off
the transformation.
Understanding the link between the classes and namespace elements will give us much more command of the framework. However, you are strongly encouraged to use namespaces to configure these endpoints, instead of using the API classes.
Consumers
If you recall from the earlier chapter on channels, there are two types of channels: one is pollable while the other is subscribable. Based on the same definition, we have two types of endpoint consumers: Polling Consumer and an Event-Driven Consumer.
A PollingConsumer polls the channel for
messages based on a polling configuration. It is driven by the client
program. The EventDrivenConsumer, on the other hand, subscribes to a subscribable ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access