activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1063912 - in /activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp: MessageConsumer.cs Session.cs
Date Wed, 26 Jan 2011 22:52:30 GMT
Author: tabish
Date: Wed Jan 26 22:52:30 2011
New Revision: 1063912

URL: http://svn.apache.org/viewvc?rev=1063912&view=rev
Log:
Merged

fix for: https://issues.apache.org/jira/browse/AMQNET-314
fix for: https://issues.apache.org/jira/browse/AMQNET-313

Modified:
    activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/MessageConsumer.cs
    activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/Session.cs

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/MessageConsumer.cs?rev=1063912&r1=1063911&r2=1063912&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/MessageConsumer.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/MessageConsumer.cs
Wed Jan 26 22:52:30 2011
@@ -55,8 +55,8 @@ namespace Apache.NMS.Stomp
         private bool inProgressClearRequiredFlag;
 
         private event MessageListener listener;
-
         private IRedeliveryPolicy redeliveryPolicy;
+        private Exception failureError;
 
         // Constructor internal to prevent clients from creating an instance.
         internal MessageConsumer(Session session, ConsumerInfo info)
@@ -534,7 +534,14 @@ namespace Apache.NMS.Stomp
                     }
                     else
                     {
-                        return null;
+                        if(this.failureError != null)
+                        {
+                            throw NMSExceptionSupport.Create(FailureError);
+                        }
+                        else
+                        {
+                            return null;
+                        }
                     }
                 }
                 else if(dispatch.Message == null)
@@ -878,10 +885,16 @@ namespace Apache.NMS.Stomp
         {
             if(this.listener != null)
             {
-                throw new NMSException("Cannot set Async listeners on Consumers with a prefetch
limit of zero");
+                throw new NMSException("Cannot perform a Synchronous Receive when there is
a registered asynchronous listener.");
             }
         }
 
+        public Exception FailureError
+        {
+            get { return this.failureError; }
+            set { this.failureError = value; }
+        }
+
         #region Nested ISyncronization Types
 
         class MessageConsumerSynchronization : ISynchronization

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/Session.cs?rev=1063912&r1=1063911&r2=1063912&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x/src/main/csharp/Session.cs Wed
Jan 26 22:52:30 2011
@@ -303,6 +303,7 @@ namespace Apache.NMS.Stomp
                     {
                         foreach(MessageConsumer consumer in consumers.Values)
                         {
+                            consumer.FailureError = this.connection.FirstFailureError;
                             consumer.DoClose();
                         }
                     }



Mime
View raw message