7 Eylül 2023 Perşembe

SpringIntegration Message Channel (Point-to-Point)

Örnek
Şöyle yaparız
@Configuration
public class PointToPointConfig {

  @Bean
  public MessageChannel inputChannel() {
    return new DirectChannel();
  }

  @Bean
  public MessageChannel outputChannel() {
    return new DirectChannel();
  }

  @Bean
  @ServiceActivator(inputChannel = "inputChannel", outputChannel = "outputChannel")
  public Transformer uppercaseTransformer() {
    return new AbstractTransformer() {
      @Override
      protected Object doTransform(Message<?> message) {
        return message.getPayload().toString().toUpperCase();
      }
    };
  }
}

Hiç yorum yok:

Yorum Gönder