1
votes

I'm trying to set up a simple wiretap for logging in Spring. Towards this end I have

.wireTap("loggingFlow.input")

in my flow and then

@Bean 
public IntegrationFlow loggingFlow() {
    return f -> f.log();
}

following what I found at http://docs.spring.io/spring-integration/reference/html/messaging-channels-section.html

which gives me a MessageDeliveryException with Dispatcher has no subscribers for channel 'application:local.loggingFlow.channel#1'.

I did notice while writing this that the above link has the .wireTap() on a MessageChannels.queue() rather than on a flow & I wonder if that's why this doesn't work. Any suggestions on how to most concisely enable logging with wiretaps in my flow?

1

1 Answers

2
votes

.log() itself is a wiretap. It currently can't be the last element in a flow. Fixed in 5.0. Workaround is to add .channel("nullChannel") after a final .log().

Or just use .log instead of .wiretap.