activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: AMQ-4801: Fixed chat example to not log ERROR on initial connection.
Date Mon, 14 Oct 2013 10:19:49 GMT
Updated Branches:
  refs/heads/trunk 98803a594 -> 6d15c348b


AMQ-4801: Fixed chat example to not log ERROR on initial connection.


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

Branch: refs/heads/trunk
Commit: 6d15c348ba5f4f9e6e708c0114ee59a3921e19bc
Parents: 98803a5
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Mon Oct 14 12:17:35 2013 +0200
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Mon Oct 14 12:17:35 2013 +0200

----------------------------------------------------------------------
 .../org/apache/activemq/web/AjaxListener.java     | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/6d15c348/activemq-web/src/main/java/org/apache/activemq/web/AjaxListener.java
----------------------------------------------------------------------
diff --git a/activemq-web/src/main/java/org/apache/activemq/web/AjaxListener.java b/activemq-web/src/main/java/org/apache/activemq/web/AjaxListener.java
index df7d21e..4c9a8c0 100644
--- a/activemq-web/src/main/java/org/apache/activemq/web/AjaxListener.java
+++ b/activemq-web/src/main/java/org/apache/activemq/web/AjaxListener.java
@@ -58,40 +58,40 @@ public class AjaxListener implements MessageAvailableListener {
 
     @Override
     public synchronized void onMessageAvailable(MessageConsumer consumer) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("message for " + consumer + " continuation=" + continuation);
-        }
+        LOG.debug("Message for consumer: {} continuation: {}", consumer, continuation);
+
         if (continuation != null) {
             try {
                 Message message = consumer.receive(10);
                 LOG.debug("message is " + message);
                 if (message != null) {
-                    if (!continuation.isResumed()) {
-                        LOG.debug("Resuming suspended continuation " + continuation);
+                    if (!continuation.isResumed() && !continuation.isInitial()) {
+                        LOG.debug("Resuming suspended continuation {}", continuation);
                         continuation.setAttribute("undelivered_message", new UndeliveredAjaxMessage(message,
consumer));
                         continuation.resume();
                     } else {
-                        LOG.debug("Message available, but continuation is already resumed.
 Buffer for next time.");
+                        LOG.debug("Message available, but continuation is already resumed.
Buffer for next time.");
                         bufferMessageForDelivery(message, consumer);
                     }
                 }
             } catch (Exception e) {
-                LOG.error("Error receiving message " + e, e);
+                LOG.warn("Error receiving message " + e.getMessage() + ". This exception
is ignored.", e);
             }
 
         } else if (System.currentTimeMillis() - lastAccess > 2 * this.maximumReadTimeout)
{
             new Thread() {
                 @Override
                 public void run() {
+                    LOG.debug("Closing consumers on client: {}", client);
                     client.closeConsumers();
-                };
+                }
             }.start();
         } else {
             try {
                 Message message = consumer.receive(10);
                 bufferMessageForDelivery(message, consumer);
             } catch (Exception e) {
-                LOG.error("Error receiving message " + e, e);
+                LOG.warn("Error receiving message " + e.getMessage() + ". This exception
is ignored.", e);
             }
         }
     }


Mime
View raw message