【问题标题】:send is not supported, because no request channel has been configured不支持发送,因为没有配置请求通道
【发布时间】:2018-11-22 00:11:00
【问题描述】:

我正在尝试配置与网关的集成流。在 kotlin 上使用 Java DSL。

网关配置:

@MessagingGateway(name = "tdiOutSenderGateway")
interface TdiOutSenderGateway {
    fun send(packet: PhasorEnricher.Packet)
}

流程配置:

@Bean
open fun tdiOutSendFlow() = IntegrationFlows
    .from(TdiOutSenderGateway::class.java)
    .transform(tdiOutSenderRouter())
    .get()!!

得到send is not supported, because no request channel has been configured docs:请求通道将被自动配置。

我错过了任何其他设置吗?

【问题讨论】:

    标签: spring-integration spring-integration-dsl


    【解决方案1】:
    1. 当然,transform应该返回一些东西,应该有route或者handle

    2. 但即使我修复了 #1,我也面临这样的问题:Void kotlin 函数返回 Unit。 Spring 集成检查Unit == nullfalse,尝试查找下一个通道并抛出错误。解决方法是使用 kotlin lambda 并显式返回 null

    3. 在使用 Spring Integration 和 kotlin 这 8 个月后,我决定尝试为 Spring Integration 创建 Kotlin DSL (https://github.com/spring-projects/spring-integration/issues/3016)

    Kotlin 单元:https://kotlinlang.org/docs/reference/functions.html#unit-returning-functions


    P.S.:当然我更早解决了它,而不是在 8 个月之后。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-04
      • 2021-11-16
      • 1970-01-01
      • 2020-02-10
      • 2018-06-27
      • 2021-11-12
      相关资源
      最近更新 更多