Tag: spring integration dsl

使用Java DSL进行Spring集成的动态TCP服务器

我试图通过读取包含连接细节的属性文件来创建TCP服务器和客户端。 我在下面的参考文档(9.20动态和运行时集成流程)的帮助下使用动态和运行时集成流程 代码在创建客户端时工作正常,但是当我使用相同代码中的更改创建服务器时,如下所示: IntegrationFlow flow = f -> f .handle(Tcp.inboundAdapter(Tcp.netServer(2221) .serializer(TcpCodecs.crlf()) .deserializer(TcpCodecs.lengthHeader1()) .id(“server”))) .transform(Transformers.objectToString()); IntegrationFlowRegistration theFlow = this.flowContext.registration(flow).register(); 我收到以下错误: Caused by: java.lang.IllegalArgumentException: Found ambiguous parameter type [class java.lang.String] for method match: [public java.lang.Class org.springframework.integration.dsl.IntegrationComponentSpec.getObjectType(), public S org.springframework.integration.dsl.MessageProducerSpec.outputChannel(java.lang.String), public S org.springframework.integration.dsl.MessageProducerSpec.outputChannel(org.springframework.messaging.MessageChannel), public org.springframework.integration.ip.dsl.TcpInboundChannelAdapterSpec org.springframework.integration.ip.dsl.TcpInboundChannelAdapterSpec.taskScheduler(org.springframework.scheduling.TaskScheduler), public S org.springframework.integration.dsl.MessageProducerSpec.errorMessageStrategy(org.springframework.integration.support.ErrorMessageStrategy), public S org.springframework.integration.dsl.MessageProducerSpec.phase(int), public S org.springframework.integration.dsl.MessageProducerSpec.autoStartup(boolean), public S org.springframework.integration.dsl.MessageProducerSpec.sendTimeout(long)] […]