TcpReceivingChannelAdapter与TcpSendingMessageHandler

问题描述 投票:0回答:1

为什么可以在TcpReceivingChannelAdapter(入站适配器)上设置通道,但不能在TcpSendingMessageHandler(出站适配器)上设置?

为什么出站适配器被称为TcpSendingMessageHandler,为什么是处理程序,而不是适配器?

人们可以直观地预期入站适配器和出站适配器将是彼此的“镜像”,只是方向不同。

我的问题是Spring Integration - Inbound vs Outbound Channel Adapters问题的变化,但侧重于Spring Integration DSL API和Tcp / Ip套接字通信。

spring-integration spring-integration-dsl spring-integration-ip
1个回答
1
投票

使用端点(服务激活器,出站通道适配器,出站网关等)。由两个bean组成,Consumer(类型取决于通道类型)和消息处理程序。

通道进入消费者,消费者在收到消息时调用处理程序。

使用java配置时,@ServiceActivator注释会触发使用者bean的创建。

如果您不想使用注释,请添加ConsumerEndpointFactoryBean以创建使用者(注入处理程序bean)。

© www.soinside.com 2019 - 2024. All rights reserved.