usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [19/35] git commit: renew queue manager on every iteration
Date Wed, 01 Oct 2014 14:51:55 GMT
renew queue manager on every iteration


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/37481138
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/37481138
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/37481138

Branch: refs/heads/two-dot-o-rebuildable-index
Commit: 3748113845899da468911848fadb9ad3f1598558
Parents: 009a184
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Mon Sep 29 08:30:41 2014 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Mon Sep 29 08:30:41 2014 -0600

----------------------------------------------------------------------
 .../apache/usergrid/services/notifications/QueueListener.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/37481138/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index 043bcb2..d8acdfe 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
@@ -124,14 +124,15 @@ public class QueueListener  {
 
     private void execute(){
         Thread.currentThread().setName("Notifications_Processor"+UUID.randomUUID());
-        svcMgr = smf.getServiceManager(smf.getManagementAppId());
-        queueManager = svcMgr.getQueueManager();
+
         final AtomicInteger consecutiveExceptions = new AtomicInteger();
         LOG.info("QueueListener: Starting execute process.");
 
         // run until there are no more active jobs
         while ( true ) {
             try {
+                svcMgr = smf.getServiceManager(smf.getManagementAppId());
+                queueManager = svcMgr.getQueueManager();
                 String queueName = ApplicationQueueManager.getRandomQueue(queueNames);
                 QueueResults results = getDeliveryBatch(queueManager,queueName);
                 LOG.info("QueueListener: retrieved batch of {} messages", results.size());


Mime
View raw message