Spring Integration - Inbound vs Outbound Channel Adapters

旧城冷巷雨未停 提交于 2019-11-30 11:28:05

Channel adapters are for one-way integration (gateways are bidirectional).

Concretely, inbound adapters are at the beginning of a flow, outbound adapters terminate a flow. Flows are typically rendered (and conceptually thought of as flowing from left to right)...

inbound-c-a->someComponent->someOtherComponent->outbound-ca

(where -> represents a channel).

There are two types of inbound channel adapters:

  • MessageProducers
  • MessageSources

MessageProducers are termed "message-driven" i.e. they unilaterally produce messages in a completely asynchronous manner, as soon as they are started; examples are JMS message-driven adapter, TCP inbound channel adapter, IMAP Idle (mail) channel adapter, etc.

MessageSources on the other hand are polled - a poller with some trigger causes the framework to ask the source for a message; the trigger can be on a fixed rate, cron expression etc. Examples are the (S)FTP adapters, Mail inbound adapter (POP3. IMAP).

Examples of outbound adapters are Mail outbound adapter (SMTP).

Gateways are two-way (request/reply).

Inbound gateways are where some external system sends a request and Spring Integration replies.

Outbound gateways are where Spring Integration makes the request and some external system replies.

I hope that clears things up.

in and out are relative directions, it must have a base. in spring integration, the base is the Spring integration framework ( that can be looked as a message bus), the adapters put message into it are in, the adapters take message out from it are out.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!