Giriş
Açıklaması şöyle
Şöyle yaparız.
Şöyle yaparız.
Şöyle yaparız.
Açıklaması şöyle
Channel adapters are for one-way integration (gateways are bidirectional).Şeklen şöyledir
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-ca->someComponent->someOtherComponent->outbound-ca
İki çeşit Inbound Channel Adapter var. Açıklaması şöyleThere are two types of inbound channel adapters:Açıklaması şöyle
-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).
Inbound Channel Adapters are represented by the SourcePollingChannelAdapter. All message driven channel Adapters are MessageProducerSupport or MessageGatewaySupport.Örnek - jpa
Şöyle yaparız.
<channel id="newAssetChannel" />
<int-jpa:inbound-channel-adapter
id="newAssetChannelAdapter"
channel="newAssetChannel"
entity-manager-factory="entityManagerFactory"
entity-class="com.foo.domain.Asset"
jpa-query="select a from Asset a
where (a.status = 'NEW' or a.status = 'UPDATED')
and a.health = 'OK' ORDER BY a.priority DESC, a.updatedDate ASC"
max-results="250">
<poller fixed-rate="5000" max-messages-per-poll="1" />
</int-jpa:inbound-channel-adapter>
Örnek - fileŞöyle yaparız.
<int-file:inbound-channel-adapter directory="/app/download/client/"
id="clientFileAdapter"
channel="channelOne"
scanner="myFileScanner" prevent-duplicates="true">
<int:poller fixed-delay="1000" max-messages-per-poll="1"/>
</int-file:inbound-channel-adapter>
ÖrnekŞöyle yaparız.
<int:inbound-channel-adapter ref="xxxTask" method="executeXXXTask"
channel="fileOutChannel">
<int:poller cron="0 30 4 ? * *"/>
</int:inbound-channel-adapter>
Hiç yorum yok:
Yorum Gönder