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 2017/03/06 23:29:45 UTC

[21/50] [abbrv] activemq-nms-stomp git commit: Merged

Merged

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


Project: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/commit/d64215a2
Tree: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/tree/d64215a2
Diff: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/diff/d64215a2

Branch: refs/heads/1.5.x
Commit: d64215a29420cf611127a25768c51bb03eb7029a
Parents: c036806
Author: Timothy A. Bish <ta...@apache.org>
Authored: Wed Jan 26 22:52:30 2011 +0000
Committer: Timothy A. Bish <ta...@apache.org>
Committed: Wed Jan 26 22:52:30 2011 +0000

----------------------------------------------------------------------
 src/main/csharp/MessageConsumer.cs | 19 ++++++++++++++++---
 src/main/csharp/Session.cs         |  1 +
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/blob/d64215a2/src/main/csharp/MessageConsumer.cs
----------------------------------------------------------------------
diff --git a/src/main/csharp/MessageConsumer.cs b/src/main/csharp/MessageConsumer.cs
index 27c8b2f..0d0885e 100755
--- a/src/main/csharp/MessageConsumer.cs
+++ b/src/main/csharp/MessageConsumer.cs
@@ -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

http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/blob/d64215a2/src/main/csharp/Session.cs
----------------------------------------------------------------------
diff --git a/src/main/csharp/Session.cs b/src/main/csharp/Session.cs
index 6770283..63ed02d 100755
--- a/src/main/csharp/Session.cs
+++ b/src/main/csharp/Session.cs
@@ -303,6 +303,7 @@ namespace Apache.NMS.Stomp
                     {
                         foreach(MessageConsumer consumer in consumers.Values)
                         {
+                            consumer.FailureError = this.connection.FirstFailureError;
                             consumer.DoClose();
                         }
                     }