You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2014/01/22 19:26:19 UTC
svn commit: r1560463 -
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Author: tabish
Date: Wed Jan 22 18:26:18 2014
New Revision: 1560463
URL: http://svn.apache.org/r1560463
Log:
https://issues.apache.org/jira/browse/AMQNET-467
CheckConnected was not processing error responses that contained security exceptions.
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=1560463&r1=1560462&r2=1560463&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Wed Jan 22 18:26:18 2014
@@ -846,6 +846,9 @@ namespace Apache.NMS.ActiveMQ
ExceptionResponse exceptionResponse = (ExceptionResponse) response;
Exception exception = CreateExceptionFromBrokerError(exceptionResponse.Exception);
+ Tracer.DebugFormat("Error returned for request {0} error type: {1}",
+ command, exception);
+
// Security exception on connect means this Connection is unusable, close the
// transport now to free its resources.
if (exception is NMSSecurityException && command.IsConnectionInfo)
@@ -983,7 +986,19 @@ namespace Apache.NMS.ActiveMQ
{
ExceptionResponse error = response as ExceptionResponse;
NMSException exception = CreateExceptionFromBrokerError(error.Exception);
- if(exception is InvalidClientIDException)
+ if (exception is NMSSecurityException)
+ {
+ try
+ {
+ transport.Dispose();
+ }
+ catch
+ {
+ }
+
+ throw exception;
+ }
+ else if(exception is InvalidClientIDException)
{
// This is non-recoverable.
// Shutdown the transport connection, and re-create it, but don't start it.