Search code examples
spring-integrationspring-integration-dsl

Spring Integration Java DSL: How to route the flow to the channel which name is static?


How to route the flow to the next channel with the static flow name? If I try this

@Bean
private IntegrationFlow postDataToMyChannel() {
    return f -> f
            ...
            .route("myChannel.input");
}

there comes

Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'myChannel' cannot be found on object of type 'org.springframework.messaging.support.GenericMessage' - maybe not public or not valid?

Solution

  • Make it a literal expression

    .route("'myChannel.input'");