camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r945986 - in /camel/trunk/components/camel-smpp/src: main/java/org/apache/camel/component/smpp/SmppProducer.java test/java/org/apache/camel/component/smpp/SmppProducerTest.java
Date Wed, 19 May 2010 01:05:04 GMT
Author: ningjiang
Date: Wed May 19 01:05:04 2010
New Revision: 945986

URL: http://svn.apache.org/viewvc?rev=945986&view=rev
Log:
CAMEL-2733 polish the camel-smpp debug logging by applying patch with thanks to Jacov

Modified:
    camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
    camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppProducerTest.java

Modified: camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java?rev=945986&r1=945985&r2=945986&view=diff
==============================================================================
--- camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
(original)
+++ camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
Wed May 19 01:05:04 2010
@@ -111,20 +111,31 @@ public class SmppProducer extends Defaul
         try {
             messageId = doProcess(submitSm);
         } catch (Exception e) {
-            // TODO: Add some DEBUG logging that we retry one more time
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Caught exception while trying to send short message for exchange
id '"
+                        + exchange.getExchangeId() + "', retrying...", e);
+            }
             doStop();
             doStart();
             
             messageId = doProcess(submitSm);
         }
 
-        LOG.info("Sent a short message for exchange id '"
-                + exchange.getExchangeId() + "' and received message id '"
-                + messageId + "'");
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Sent a short message for exchange id '"
+                    + exchange.getExchangeId() + "' and received message id '"
+                    + messageId + "'");
+        }
 
         if (exchange.getPattern().isOutCapable()) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Exchange is out capable, setting headers on out exchange...");
+            }
             exchange.getOut().setHeader(SmppBinding.ID, messageId);
         } else {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Exchange is not out capable, setting headers on in exchange...");
+            }
             exchange.getIn().setHeader(SmppBinding.ID, messageId);
         }
     }

Modified: camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppProducerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppProducerTest.java?rev=945986&r1=945985&r2=945986&view=diff
==============================================================================
--- camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppProducerTest.java
(original)
+++ camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppProducerTest.java
Wed May 19 01:05:04 2010
@@ -255,6 +255,7 @@ public class SmppProducerTest {
         SubmitSm submitSm = createMock(SubmitSm.class);
         expect(exchange.getExchangeId()).andReturn("ID-muellerc-macbookpro/3690-1214458315718/2-0");
         expect(endpoint.getBinding()).andReturn(binding);
+        expect(exchange.getExchangeId()).andReturn("ID-muellerc-macbookpro/3690-1214458315718/2-0");
         expect(binding.createSubmitSm(exchange)).andReturn(submitSm);
         submitSmExpectations(exchange, binding, submitSm);
         expect(session.submitShortMessage(



Mime
View raw message