Skip to content

Commit 641ddea

Browse files
artembilanspring-builds
authored andcommitted
GH-9937: Remove logger.error from the TcpSendingMessageHandler
Fixes: #9937 Issue link: #9937 The `TcpSendingMessageHandler` throws exceptions to the caller this or other way. There is just no reason to have extra `logger.error()` in those cases (cherry picked from commit fe5b12d)
1 parent 8d4bcf5 commit 641ddea

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,7 +90,6 @@ protected TcpConnection obtainConnection(Message<?> message) {
9090
connection = this.clientConnectionFactory.getConnection();
9191
}
9292
catch (Exception ex) {
93-
logger.error(ex, "Error creating connection");
9493
throw new MessageHandlingException(message, "Failed to obtain a connection in the [" + this + ']', ex);
9594
}
9695
return connection;
@@ -123,7 +122,6 @@ private void handleMessageAsServer(Message<?> message) {
123122
connection.send(message);
124123
}
125124
catch (Exception ex) {
126-
logger.error(ex, "Error sending message");
127125
connection.close();
128126
throw IntegrationUtils.wrapInHandlingExceptionIfNecessary(message,
129127
() -> "Error sending message in the [" + this + ']', ex);
@@ -135,7 +133,6 @@ private void handleMessageAsServer(Message<?> message) {
135133
}
136134
}
137135
else {
138-
logger.error(() -> "Unable to find outbound socket for " + message);
139136
MessageHandlingException messageHandlingException =
140137
new MessageHandlingException(message, "Unable to find outbound socket in the [" + this + ']');
141138
publishNoConnectionEvent(messageHandlingException, connectionId);

0 commit comments

Comments
 (0)