GH-114: Fix TcpConsumerConfiguration for auto-wire ambiguity

Fixes: https://github.com/spring-cloud/spring-functions-catalog/issues/114
This commit is contained in:
Artem Bilan
2024-12-19 12:29:00 -05:00
parent 19cc51fc36
commit 03067496dc

View File

@@ -38,14 +38,15 @@ import org.springframework.messaging.Message;
* @author Gary Russell
* @author Christian Tzolov
* @author Chris Bono
* @author Artem Bilan
*/
@AutoConfiguration
@EnableConfigurationProperties({ TcpConsumerProperties.class, TcpConnectionFactoryProperties.class })
public class TcpConsumerConfiguration {
private TcpConsumerProperties properties;
private final TcpConsumerProperties properties;
private TcpConnectionFactoryProperties tcpConnectionProperties;
private final TcpConnectionFactoryProperties tcpConnectionProperties;
public TcpConsumerConfiguration(TcpConsumerProperties properties,
TcpConnectionFactoryProperties tcpConnectionProperties) {
@@ -55,12 +56,12 @@ public class TcpConsumerConfiguration {
}
@Bean
public Consumer<Message<?>> tcpConsumer(TcpSendingMessageHandlerSmartLifeCycle handler) {
return handler::handleMessage;
public Consumer<Message<?>> tcpConsumer(TcpSendingMessageHandler tcpConsumerMessageHandler) {
return tcpConsumerMessageHandler::handleMessage;
}
@Bean
public TcpSendingMessageHandlerSmartLifeCycle handler(
public TcpSendingMessageHandler tcpConsumerMessageHandler(
@Qualifier("tcpSinkConnectionFactory") AbstractConnectionFactory connectionFactory) {
TcpSendingMessageHandlerSmartLifeCycle tcpMessageHandler = new TcpSendingMessageHandlerSmartLifeCycle();