This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new fea2be6a3a ARTEMIS-4921 include protocol name in disconnection log 
message
fea2be6a3a is described below

commit fea2be6a3a828495712d58dff35d55acaf64e68f
Author: Justin Bertram <[email protected]>
AuthorDate: Wed Jul 10 22:54:34 2024 -0500

    ARTEMIS-4921 include protocol name in disconnection log message
---
 .../org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java | 4 ++--
 .../artemis/core/protocol/core/impl/RemotingConnectionImpl.java       | 2 +-
 .../protocol/amqp/broker/ActiveMQProtonRemotingConnection.java        | 2 +-
 .../activemq/artemis/core/protocol/openwire/OpenWireConnection.java   | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
index b925090199..027543cdf7 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
@@ -133,8 +133,8 @@ public interface ActiveMQClientLogger {
    @LogMessage(id = 212036, value = "Can not find packet to clear: {} last 
received command id first stored command id {}", level = LogMessage.Level.WARN)
    void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer 
firstStoredCommandID);
 
-   @LogMessage(id = 212037, value = "Connection failure to {} has been 
detected: {} [code={}]", level = LogMessage.Level.WARN)
-   void connectionFailureDetected(String remoteAddress, String message, 
ActiveMQExceptionType type);
+   @LogMessage(id = 212037, value = "{} connection failure to {} has been 
detected: {} [code={}]", level = LogMessage.Level.WARN)
+   void connectionFailureDetected(String protocol, String remoteAddress, 
String message, ActiveMQExceptionType type);
 
    @LogMessage(id = 212038, value = "Failure in calling interceptor: {}", 
level = LogMessage.Level.WARN)
    void errorCallingInterceptor(Interceptor interceptor, Throwable e);
diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
index 1d47d56ffb..00d92e0115 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
@@ -200,7 +200,7 @@ public class RemotingConnectionImpl extends 
AbstractRemotingConnection implement
       }
 
       if (!(me instanceof ActiveMQRemoteDisconnectException) && !(me 
instanceof ActiveMQRoutingException) && !(me instanceof 
ActiveMQDisconnectedException)) {
-         
ActiveMQClientLogger.LOGGER.connectionFailureDetected(transportConnection.getRemoteAddress(),
 me.getMessage(), me.getType());
+         
ActiveMQClientLogger.LOGGER.connectionFailureDetected(transportConnection.getProtocolConnection().getProtocolName(),
 transportConnection.getRemoteAddress(), me.getMessage(), me.getType());
       } else if (me instanceof ActiveMQDisconnectedException) {
          
ActiveMQClientLogger.LOGGER.connectionClosureDetected(transportConnection.getRemoteAddress(),
 me.getMessage(), me.getType());
       }
diff --git 
a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
 
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
index 2606f73945..7daf51a95d 100644
--- 
a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
+++ 
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java
@@ -89,7 +89,7 @@ public class ActiveMQProtonRemotingConnection extends 
AbstractRemotingConnection
       try {
          if (amqpConnection.getHandler().getConnection().getRemoteState() != 
EndpointState.CLOSED) {
             // A remote close was received on the client, on that case it's 
just a normal operation and we don't need to log this.
-            
ActiveMQClientLogger.LOGGER.connectionFailureDetected(amqpConnection.getConnectionCallback().getTransportConnection().getRemoteAddress(),
 me.getMessage(), me.getType());
+            
ActiveMQClientLogger.LOGGER.connectionFailureDetected(amqpConnection.getConnectionCallback().getTransportConnection().getProtocolConnection().getProtocolName(),
 
amqpConnection.getConnectionCallback().getTransportConnection().getRemoteAddress(),
 me.getMessage(), me.getType());
          }
       } catch (Throwable e) { // avoiding NPEs from te logging statement. I 
don't think this would happen, but just in case
          logger.warn(e.getMessage(), e);
diff --git 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index efab73159b..733a60f82f 100644
--- 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -783,7 +783,7 @@ public class OpenWireConnection extends 
AbstractRemotingConnection implements Se
          if (me != null) {
             //filter it like the other protocols
             if (!(me instanceof ActiveMQRemoteDisconnectException)) {
-               
ActiveMQClientLogger.LOGGER.connectionFailureDetected(this.transportConnection.getRemoteAddress(),
 me.getMessage(), me.getType());
+               
ActiveMQClientLogger.LOGGER.connectionFailureDetected(this.transportConnection.getProtocolConnection().getProtocolName(),
 this.transportConnection.getRemoteAddress(), me.getMessage(), me.getType());
             }
          }
          try {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to