[ 
https://issues.apache.org/jira/browse/AMQNET-848?focusedWorklogId=974431&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-974431
 ]

ASF GitHub Bot logged work on AMQNET-848:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jul/25 11:48
            Start Date: 13/Jul/25 11:48
    Worklog Time Spent: 10m 
      Work Description: muralim1969 commented on code in PR #42:
URL: 
https://github.com/apache/activemq-nms-openwire/pull/42#discussion_r2203363026


##########
src/Util/ExceptionFromBrokerError.cs:
##########
@@ -0,0 +1,78 @@
+using Apache.NMS.ActiveMQ.Commands;
+using System;
+using System.Reflection;
+
+
+namespace Apache.NMS.ActiveMQ.Util
+{
+    internal class ExceptionFromBrokerError
+    {
+        public static NMSException CreateExceptionFromBrokerError(BrokerError 
brokerError)
+        {
+            String exceptionClassName = brokerError.ExceptionClass;
+
+            if (String.IsNullOrEmpty(exceptionClassName))
+            {
+                return new BrokerException(brokerError);
+            }
+
+            NMSException exception = null;
+            String message = brokerError.Message;
+
+            // We only create instances of exceptions from the NMS API
+            Assembly nmsAssembly = Assembly.GetAssembly(typeof(NMSException));
+
+            // First try and see if it's one we populated ourselves in which 
case
+            // it will have the correct namespace and exception name.
+            Type exceptionType = nmsAssembly.GetType(exceptionClassName, 
false, true);

Review Comment:
   This method is called only in the exception scenario and this optimization 
is not required





Issue Time Tracking
-------------------

    Worklog Id:     (was: 974431)
    Time Spent: 0.5h  (was: 20m)

> Failover Transport Protocol Excessive Reconnection Attempts on Credential 
> Failure
> ---------------------------------------------------------------------------------
>
>                 Key: AMQNET-848
>                 URL: https://issues.apache.org/jira/browse/AMQNET-848
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: OpenWire-2.1.0
>            Reporter: Murali Mogalayapalli
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> *Failover Transport Protocol behavior:*
> When authentication credentials are invalid (e.g., expired or incorrect), the 
> AMQNet client’s *failover mechanism* enters a rapid reconnect loop. This 
> results in a high-frequency reconnection pattern that behaves like a 
> *denial-of-service (DoS)* against the broker.
> *Problem*
> The InactivityMonitor::OnCommand method doesn't handle the ExceptionResponse 
> resulting in this behavior.
> *Fix*
>  * Handle the ExceptionResponse the way it is handled in 
> Conection::SyncRequestAsync method. Propagate the exception
>  * Bail out the FailoverTransport from reconnecting when a 
> NMSSecurityException is passed to  FailoverTransport::HandleTransportFailure  
> method.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
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