activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1085337 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
Date Fri, 25 Mar 2011 11:52:49 GMT
Author: gtully
Date: Fri Mar 25 11:52:49 2011
New Revision: 1085337

URL: http://svn.apache.org/viewvc?rev=1085337&view=rev
Log:
help diagnose jenkins failure with expired messages advisory error, tidy up logging to include
exception

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java?rev=1085337&r1=1085336&r2=1085337&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/advisory/AdvisoryBroker.java
Fri Mar 25 11:52:49 2011
@@ -263,7 +263,7 @@ public class AdvisoryBroker extends Brok
                 fireAdvisory(context, topic, payload, null, advisoryMessage);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to fire message expired advisory");
+            handleFireFailure("expired", e);
         }
     }
     
@@ -278,7 +278,7 @@ public class AdvisoryBroker extends Brok
                 fireAdvisory(context, topic,payload);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to fire message consumed advisory");
+            handleFireFailure("consumed", e);
         }
     }
     
@@ -293,7 +293,7 @@ public class AdvisoryBroker extends Brok
                 fireAdvisory(context, topic,payload);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to fire message delivered advisory");
+            handleFireFailure("delivered", e);
         }
     }
     
@@ -313,7 +313,7 @@ public class AdvisoryBroker extends Brok
                 fireAdvisory(context, topic, payload, null, advisoryMessage);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to fire message discarded advisory");
+            handleFireFailure("discarded", e);
         }
     }
     
@@ -326,7 +326,7 @@ public class AdvisoryBroker extends Brok
             advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_ID, subs.getConsumerInfo().getConsumerId().toString());
             fireAdvisory(context, topic, subs.getConsumerInfo(), null, advisoryMessage);
         } catch (Exception e) {
-            LOG.warn("Failed to fire message slow consumer advisory");
+            handleFireFailure("slow consumer", e);
         }
     }
     
@@ -339,7 +339,7 @@ public class AdvisoryBroker extends Brok
             advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_PRODUCER_ID, producerInfo.getProducerId().toString());
             fireAdvisory(context, topic, producerInfo, null, advisoryMessage);
         } catch (Exception e) {
-            LOG.warn("Failed to fire message fast producer advisory");
+            handleFireFailure("fast producer", e);
         }
     }
     
@@ -355,7 +355,7 @@ public class AdvisoryBroker extends Brok
                 fireAdvisory(context, topic, null, null, advisoryMessage);
 
             } catch (Exception e) {
-                LOG.warn("Failed to fire message is full advisory");
+                handleFireFailure("is full", e);
             }
         }
     }
@@ -371,7 +371,7 @@ public class AdvisoryBroker extends Brok
             context.setBroker(getBrokerService().getBroker());
             fireAdvisory(context, topic,null,null,advisoryMessage);
         } catch (Exception e) {
-            LOG.warn("Failed to fire message master broker advisory");
+            handleFireFailure("now master broker", e);
         }
     }
     
@@ -387,7 +387,7 @@ public class AdvisoryBroker extends Brok
                 fireAdvisory(context, topic,payload);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to fire message consumed advisory");
+            handleFireFailure("add to DLQ", e);
         } 
     }
 
@@ -407,7 +407,7 @@ public class AdvisoryBroker extends Brok
              fireAdvisory(context, topic, brokerInfo, null, advisoryMessage);
          }
         } catch (Exception e) {
-            LOG.warn("Failed to fire network bridge advisory");
+            handleFireFailure("network bridge started", e);
         }
     }
 
@@ -426,7 +426,14 @@ public class AdvisoryBroker extends Brok
              fireAdvisory(context, topic, brokerInfo, null, advisoryMessage);
          }
         } catch (Exception e) {
-            LOG.warn("Failed to fire network bridge advisory");
+            handleFireFailure("network bridge stopped", e);
+        }
+    }
+
+    private void handleFireFailure(String message, Throwable cause) {
+        LOG.warn("Failed to fire "  + message + " advisory, reason: " + cause);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(message + " detail", cause);
         }
     }
 



Mime
View raw message