Don Hosek
Don Hosek

Reputation: 1033

Setting up wiretap for logging in Spring Integration (with DSL)

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?

Upvotes: 1

Views: 1623

Answers (1)

Gary Russell
Gary Russell

Reputation: 174574

.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.

Upvotes: 2

Related Questions