0

I am integrating with one of the external vendor with spring-ip integration. I would like intercept the messages (much like web filters) to print to log file them before and after the transformation for logging and debugging purpose. As the message to log will be customized as I don't want to print all the elements in the message and would like to customize in the interceptor. I tried with wiretap but didn't help much. Any advice?

@Bean
public IntegrationFlow flow() {
    return f -> f.channel("inputChannel")
            //Before : logging interceptor before message convert to byte[]
            .transform(new OutboundMessageTransformer())
            .handle(tcpOutputGateway())
            .transform(new InboundMessageTransformer());
            //After : logging interceptor after message byte[] is being
             parsed

}
Sujit
  • 468
  • 1
  • 8
  • 22
  • Have you looked at the .log() methods? – Gary Russell Jun 22 '19 at 01:49
  • I looked at the log method and added a lambda to construct the logging string from the message payload which is works fine. If I wanted to log multiple logging strings, I am wondering if I need to use chained logging or there is any other way? I am going thru the logging and wire-tap section of spring integration documentation as well. – Sujit Jun 22 '19 at 23:26
  • What is that “chained logging”? You asked about logging around that `handle()` and Gary has answered to you how. Sounds like anything else is already out of this question scope – Artem Bilan Jun 23 '19 at 02:23

0 Answers0