Daniel Frank
Daniel Frank

Reputation: 99

UnsupportedOperationException in wire tap after spring-integration update

I'm testing my existent application with a new spring-integration version. Unfortunately, I'm getting a unexpected exception, like below:

Caused by: java.lang.UnsupportedOperationException: null
    at org.springframework.integration.dsl.StandardIntegrationFlow.configure(StandardIntegrationFlow.java:64) ~[spring-integration-java-dsl-1.2.1.RELEASE.jar:na]
    at org.springframework.integration.dsl.IntegrationFlowDefinition.wireTap(IntegrationFlowDefinition.java:341) ~[spring-integration-java-dsl-1.2.1.RELEASE.jar:na]
    at org.springframework.integration.dsl.IntegrationFlowDefinition.wireTap(IntegrationFlowDefinition.java:276) ~[spring-integration-java-dsl-1.2.1.RELEASE.jar:na]
    at com.smartplan.maiscontrole.config.ReportGenerationFlowConfig.buildFlow(ReportGenerationFlowConfig.java:49) ~[main/:na]

My code, actually looks like:

@Override
protected IntegrationFlowDefinition<?> buildFlow() {
    return this.from(this.requestChannel())               
               .wireTap(this.sideEffectFlow())               
               .channel(new NullChannel());
}

@Bean
MessageChannel requestChannel() {
    return MessageChannels.direct();
}

@Bean
IntegrationFlow sideEffectFlow() {
    return f -> f.handle(System.out::println);
}

Any clue about this?

Upvotes: 3

Views: 332

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121292

M-m-m, I think it's really UnsupportedOperationException. Try to remove @Bean from that sideEffectFlow.

Nested flows can't be beans. Or connect them via channels.

Upvotes: 3

Related Questions