-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove unnecessary error()
log message from the TcpSendingMessageHandler
#9937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
which version is it available? Just wanted to check I believe only gateway receives the error from the call site, but if we are using adapter, what will happen? I believe there is no error channel on int-ip:tcp-outbound-channel-adapter |
It is not available yet. The error channel on the inbound gateway is for standard messaging error handling. But that error is still an exception thrown from downstream flow . Where the mentioned outbound channel adapter is the end of integration flow. So, if you just send message over there manually, not via inbound event, then just Also, see a |
@artembilan not even snapshot one? Gateway is easier to handle. Only issue is adapter here. For example this one: <!-- TCP client connection factory (connects to TCP server at localhost:12345) -->
<bean id="tcpClientConnectionFactory"
class="org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory">
<constructor-arg value="localhost" />
<constructor-arg value="12345" />
</bean>
<!-- Wrap the connection factory with a caching client connection factory (cache size: 10) -->
<bean id="cachingClientConnectionFactory"
class="org.springframework.integration.ip.tcp.connection.CachingClientConnectionFactory">
<constructor-arg ref="tcpClientConnectionFactory" />
<constructor-arg value="3" />
</bean>
<!-- Outbound adapter: sends messages on the TCP connection using the caching connection factory -->
<int-ip:tcp-outbound-channel-adapter id="tcpOutboundAdapter"
connection-factory="cachingClientConnectionFactory"
channel="tcpOut" />
<!-- Inbound adapter: listens for replies on the TCP connection in client mode -->
<int-ip:tcp-inbound-channel-adapter id="tcpInboundAdapter"
connection-factory="cachingClientConnectionFactory"
channel="tcpReplyChannel"
/>
<!-- Define channels -->
<int:channel id="tcpOut" />
<int:channel id="tcpReplyChannel" />
<!-- Service activator that prints any reply received -->
<int:service-activator input-channel="tcpReplyChannel" ref="replyPrinter" method="printReply" />
<!-- A simple bean that prints the reply message -->
<bean id="replyPrinter" class="com.example.demo.ReplyPrinter" /> Today it throws the errror org.springframework.integration.util.PoolItemNotAvailableException: Failed to obtain pooled item I also want these logs to be suppressed, and wish there is better option. |
Snapshots are there in the: https://repo.spring.io/snapshot. We don’t see from your code what produces messages to that |
I am just doing simple tests. Oh sorry for not providing full code:
|
I checked 6.5.0-SNAPSHOT It looks good thanks.
|
Right. So, you do manually Thank you for confirming about |
@artembilan For synchronous channel, I am good. I was just worried about asynchronous channels where error isn't thrown because it is asynchronous. But as per the docs, starting with 5.4.3, errors aren't silently ignored, so we should be good here. I was just worried that after removing logs, we may silently ignore the error in various situation. After looking docs, I believe there is no such situation after 5.4.3. |
For async channel you should use an |
@artembilan Yea, looks good. Thanks for removing the redundant logs as it was producing same error two times previously. And, I believe subscribing error channel is compulsory, so people won't miss errors. |
More info in SO: https://stackoverflow.com/questions/79547786/how-to-silence-spring-integration-tcp-pool-timeout
The text was updated successfully, but these errors were encountered: