Spring 如何记录空通道

Spring 如何记录空通道,spring,spring-boot,spring-integration,spring-integration-sftp,spring-integration-aws,Spring,Spring Boot,Spring Integration,Spring Integration Sftp,Spring Integration Aws,在SpringBoot-integration中,有一个将重命名该文件的过滤器,如果实例仅成功重命名该文件,它应该继续该流,否则它将被传递到空通道 要记录空通道以查看未成功重命名的文件名 尝试了以下解决方案。但在应用程序启动期间发生异常。你能提出实现这一目标的解决方案吗 <integration:filter input-channel="filesInChannel" expression="headers['file_originalFile'].renameTo(new java.i

在SpringBoot-integration中,有一个将重命名该文件的过滤器,如果实例仅成功重命名该文件,它应该继续该流,否则它将被传递到空通道

要记录空通道以查看未成功重命名的文件名

尝试了以下解决方案。但在应用程序启动期间发生异常。你能提出实现这一目标的解决方案吗

<integration:filter input-channel="filesInChannel" expression="headers['file_originalFile'].renameTo(new java.io.File(headers['file_originalFile'].absolutePath + '.lock'))" 
        output-channel="filesHeaderEnricher" discard-channel="nullChannel" throw-exception-on-rejection="false">
</integration:filter> 
<integration:channel id="nullChannel">
  <integration:interceptors>
    <integration:wire-tap channel="logNullChannel"/>
 </integration:interceptors>
</integration:channel>
<integration:logging-channel-adapter id="logNullChannel" level="DEBUG"/>
根本无法拦截nullChannel。您需要考虑其他用例,或者打开Null通道类别的调试日志:

 if (this.loggingEnabled && this.logger.isDebugEnabled()) {
        this.logger.debug("message sent to null channel: " + message);
    }
 if (this.loggingEnabled && this.logger.isDebugEnabled()) {
        this.logger.debug("message sent to null channel: " + message);
    }