25 Aralık 2019 Çarşamba

SpringIntegration IntegrationFlows Sınıfı

Giriş
Açıklaması şöyle.
An integration scenario is represented using an “IntegrationFlow” interface in Spring Integration. One of the ways of creating this would be to use a builder pattern starting with the “IntegrationFlows” class. Here, you can use this to create an input channel adapter in order to get messages into the system and connect them to a message channel. Each message that is created and put through the message channels are represented using the “Message” interface. This will contain a domain-specific “payload” value and a set of headers.
route metodu - Producer Flow
Açıklaması şöyle. markers ve lines isimli iki tane IntegrationFlow tipinden bean olduğu anlatılıyor.
For each bean representing a message endpoint, you can reach its implicit input channel by simply appending “.input” to the bean name. This is how the “markers” and “lines” message endpoints’ input channels are named “markers.input” and “lines.input”, respectively. 
Örnek
Şöyle yaparız. Yapılan işlem sonucunu route() metodu ile başka kanala gönderir.
@Bean
public IntegrationFlow fromFile() {
  return IntegrationFlows.from(...)
    .handle(...)
    .<Object, Class<?>>route(...)
    .get();
}

Hiç yorum yok:

Yorum Gönder