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:36:25 UTC
svn commit: r1560466 - in
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x: ./
src/main/csharp/Connection.cs
Author: tabish
Date: Wed Jan 22 18:36:24 2014
New Revision: 1560466
URL: http://svn.apache.org/r1560466
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/branches/1.6.x/ (props changed)
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/Connection.cs
Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/
------------------------------------------------------------------------------
Merged /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk:r1560463
Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/Connection.cs?rev=1560466&r1=1560465&r2=1560466&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/Connection.cs Wed Jan 22 18:36:24 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.