Tiago Medici
Tiago Medici

Reputation: 2204

spring integration specific channels

what is the relation to the channels : DirectChannel, QueueChannel, ExecutorChannel, PriorityChannel, RendezvousChannel, PublishSubscribeChannel to integration components in case the best approach to use them ?

Upvotes: 2

Views: 196

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121560

There are 3 first class citizen in Spring Integration: Endpoint, Channel and Handler. The endpoint gets data from the channel to handle it in the handler.

Different channel types serve for different approaches to get data from it by the endpoint.

DirectChannel is very simple and its data is handled directly from the caller's thread. Like in simple raw Java - main -> service method.

QueueChannel is for buffering data in the internal queue. The endpoint polls data from there int its desired pace.

ExecutorChannel just shifts the data to the free thread of the configured Executor. Then handler is called on that thread already.

PriorityChannel is similar to the QueueChannel, but with the order capability for that data which is stored in the internal queue in the moment of send.

RendezvousChannel is fully based on the SynchronousQueue from Java.

PublishSubscribeChannel provides a-la topic implementation - all the handlers will get the same message.

More info on the matter in the documentation and JavaDocs.

Also don't forget about theory on the matter: http://www.enterpriseintegrationpatterns.com/

Upvotes: 5

Related Questions