camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1239080 - in /camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms: ./ reply/
Date Wed, 01 Feb 2012 11:27:41 GMT
Author: davsclaus
Date: Wed Feb  1 11:27:41 2012
New Revision: 1239080

URL: http://svn.apache.org/viewvc?rev=1239080&view=rev
Log:
camel-jms is now less noisy in its logging by default.

Modified:
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/UseMessageIdAsCorrelationIdMessageSentCallback.java

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
Wed Feb  1 11:27:41 2012
@@ -82,7 +82,7 @@ public class EndpointMessageListener imp
             }
             String correlationId = message.getJMSCorrelationID();
             if (correlationId != null) {
-                LOG.debug("Received Message has JMSCorrelationID [" + correlationId + "]");
+                LOG.debug("Received Message has JMSCorrelationID [{}]", correlationId);
             }
 
             // process the exchange either asynchronously or synchronous
@@ -97,7 +97,9 @@ public class EndpointMessageListener imp
             boolean forceSync = endpoint.isSynchronous() || endpoint.isTransacted();
             if (forceSync || !isAsync()) {
                 // must process synchronous if transacted or configured to do so
-                LOG.trace("Processing exchange {} synchronously", exchange.getExchangeId());
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Processing exchange {} synchronously", exchange.getExchangeId());
+                }
                 try {
                     processor.process(exchange);
                 } catch (Exception e) {
@@ -107,7 +109,9 @@ public class EndpointMessageListener imp
                 }
             } else {
                 // process asynchronous using the async routing engine
-                LOG.trace("Processing exchange {} asynchronously", exchange.getExchangeId());
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Processing exchange {} asynchronously", exchange.getExchangeId());
+                }
                 boolean sync = AsyncProcessorHelper.process(processor, exchange, callback);
                 if (!sync) {
                     // will be done async so return now

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
Wed Feb  1 11:27:41 2012
@@ -213,7 +213,7 @@ public class JmsBinding {
 
     protected byte[] createByteArrayFromBytesMessage(BytesMessage message) throws JMSException
{
         if (message.getBodyLength() > Integer.MAX_VALUE) {
-            LOG.warn("Length of BytesMessage is too long: " + message.getBodyLength());
+            LOG.warn("Length of BytesMessage is too long: {}", message.getBodyLength());
             return null;
         }
         byte[] result = new byte[(int)message.getBodyLength()];

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
Wed Feb  1 11:27:41 2012
@@ -272,7 +272,7 @@ public class JmsConfiguration implements
                 }
                 super.doSend(producer, message);
                 if (LOG.isTraceEnabled()) {
-                    LOG.trace("Sent JMS message to: " + producer.getDestination() + " with
message: " + message);
+                    LOG.trace("Sent JMS message to: {} with message: {}", producer.getDestination(),
message);
                 }
             }
         }

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
Wed Feb  1 11:27:41 2012
@@ -97,7 +97,7 @@ public class JmsConsumer extends Default
             Connection con = listenerContainer.getConnectionFactory().createConnection();
             JmsUtils.closeConnection(con);
 
-            log.info("Successfully tested JMS Connection on startup for destination: " +
getDestinationName());
+            log.debug("Successfully tested JMS Connection on startup for destination: {}",
getDestinationName());
         } catch (Exception e) {
             String msg = "Cannot get JMS Connection on startup for destination " + getDestinationName();
             throw new FailedToCreateConsumerException(getEndpoint(), msg, e);

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
Wed Feb  1 11:27:41 2012
@@ -77,10 +77,12 @@ public class JmsProducer extends Default
 
                     if (endpoint.getReplyTo() != null) {
                         replyManager = endpoint.getReplyManager(endpoint.getReplyTo());
-                        LOG.info("Using JmsReplyManager: " + replyManager + " to process
replies from: " + endpoint.getReplyTo());
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("Using JmsReplyManager: {} to process replies from:
{}", replyManager, endpoint.getReplyTo());
+                        }
                     } else {
                         replyManager = endpoint.getReplyManager();
-                        LOG.info("Using JmsReplyManager: " + replyManager + " to process
replies from temporary queue");
+                        LOG.debug("Using JmsReplyManager: {} to process replies from temporary
queue", replyManager);
                     }
                 } catch (Exception e) {
                     throw new FailedToCreateProducerException(endpoint, e);
@@ -240,7 +242,7 @@ public class JmsProducer extends Default
                 Object jmsReplyTo = JmsMessageHelper.getJMSReplyTo(answer);
                 if (endpoint.isDisableReplyTo()) {
                     // honor disable reply to configuration
-                    LOG.debug("ReplyTo is disabled on endpoint: {}", endpoint);
+                    LOG.trace("ReplyTo is disabled on endpoint: {}", endpoint);
                     JmsMessageHelper.setJMSReplyTo(answer, null);
                 } else {
                     // if the binding did not create the reply to then we have to try to
create it here
@@ -332,7 +334,9 @@ public class JmsProducer extends Default
 
         CamelJmsTemplate template = (CamelJmsTemplate) (inOut ? getInOutTemplate() : getInOnlyTemplate());
 
-        LOG.trace("Using {} jms template", inOut ? "inOut" : "inOnly");
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Using {} jms template", inOut ? "inOut" : "inOnly");
+        }
 
         // destination should be preferred
         if (destination != null) {
@@ -368,8 +372,7 @@ public class JmsProducer extends Default
                     out.setMessageId(out.getJmsMessage().getJMSMessageID());
                 }
             } catch (JMSException e) {
-                LOG.warn("Unable to retrieve JMSMessageID from outgoing "
-                        + "JMS Message and set it into Camel's MessageId", e);
+                LOG.warn("Unable to retrieve JMSMessageID from outgoing JMS Message and set
it into Camel's MessageId", e);
             }
         }
     }
@@ -422,11 +425,12 @@ public class JmsProducer extends Default
             Connection conn = template.getConnectionFactory().createConnection();
             JmsUtils.closeConnection(conn);
 
-            log.info("Successfully tested JMS Connection on startup for destination: " +
template.getDefaultDestinationName());
+            log.debug("Successfully tested JMS Connection on startup for destination: " +
template.getDefaultDestinationName());
         } catch (Exception e) {
             throw new FailedToCreateProducerException(getEndpoint(), e);
         }
     }
+
     protected void doStart() throws Exception {
         super.doStart();
         if (uuidGenerator == null) {

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
Wed Feb  1 11:27:41 2012
@@ -77,9 +77,8 @@ public class PersistentQueueReplyManager
         } else {
             // we could not correlate the received reply message to a matching request and
therefore
             // we cannot continue routing the unknown message
-            String text = "Reply received for unknown correlationID [" + correlationID +
"]. The message will be ignored: " + message;
             // log a warn and then ignore the message
-            log.warn(text);
+            log.warn("Reply received for unknown correlationID [{}]. The message will be
ignored: {}", correlationID, message);
         }
     }
 

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
Wed Feb  1 11:27:41 2012
@@ -96,7 +96,7 @@ public abstract class ReplyManagerSuppor
             // ignore
         }
         if (correlationID == null) {
-            log.warn("Ignoring message with no correlationID: " + message);
+            log.warn("Ignoring message with no correlationID: {}", message);
             return;
         }
 
@@ -115,9 +115,11 @@ public abstract class ReplyManagerSuppor
                 boolean timeout = holder.isTimeout();
                 if (timeout) {
                     // timeout occurred do a WARN log so its easier to spot in the logs
-                    log.warn("Timeout occurred after {} millis waiting for reply message
with correlationID [{}]."
-                            + " Setting ExchangeTimedOutException on ExchangeId: {} and continue
routing.",
-                            new Object[]{holder.getRequestTimeout(), holder.getCorrelationId(),
exchange.getExchangeId()});
+                    if (log.isWarnEnabled()) {
+                        log.warn("Timeout occurred after {} millis waiting for reply message
with correlationID [{}]."
+                                + " Setting ExchangeTimedOutException on ExchangeId: {} and
continue routing.",
+                                new Object[]{holder.getRequestTimeout(), holder.getCorrelationId(),
exchange.getExchangeId()});
+                    }
 
                     // no response, so lets set a timed out exception
                     String msg = "reply message with correlationID: " + holder.getCorrelationId()
+ " not received";
@@ -167,7 +169,7 @@ public abstract class ReplyManagerSuppor
         // event that the reply comes back really really fast, and the correlation map hasn't
yet been updated
         // from the provisional id to the JMSMessageID. If so we have to wait a bit and lookup
again.
         if (log.isWarnEnabled()) {
-            log.warn("Early reply received with correlationID [" + correlationID + "] ->
" + message);
+            log.warn("Early reply received with correlationID [{}] -> {}", correlationID,
message);
         }
 
         ReplyHandler answer = null;
@@ -210,7 +212,7 @@ public abstract class ReplyManagerSuppor
         // create JMS listener and start it
         listenerContainer = createListenerContainer();
         listenerContainer.afterPropertiesSet();
-        log.info("Starting reply listener container on endpoint: " + endpoint);
+        log.debug("Starting reply listener container on endpoint: {}", endpoint);
         listenerContainer.start();
     }
 
@@ -219,7 +221,7 @@ public abstract class ReplyManagerSuppor
         ServiceHelper.stopService(correlation);
 
         if (listenerContainer != null) {
-            log.info("Stopping reply listener container on endpoint: " + endpoint);
+            log.debug("Stopping reply listener container on endpoint: {}", endpoint);
             listenerContainer.stop();
             listenerContainer.destroy();
             listenerContainer = null;

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
Wed Feb  1 11:27:41 2012
@@ -67,9 +67,8 @@ public class TemporaryQueueReplyManager 
         } else {
             // we could not correlate the received reply message to a matching request and
therefore
             // we cannot continue routing the unknown message
-            String text = "Reply received for unknown correlationID [" + correlationID +
"]. The message will be ignored: " + message;
             // log a warn and then ignore the message
-            log.warn(text);
+            log.warn("Reply received for unknown correlationID [{}]. The message will be
ignored: {}", correlationID, message);
         }
     }
 

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/UseMessageIdAsCorrelationIdMessageSentCallback.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/UseMessageIdAsCorrelationIdMessageSentCallback.java?rev=1239080&r1=1239079&r2=1239080&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/UseMessageIdAsCorrelationIdMessageSentCallback.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/UseMessageIdAsCorrelationIdMessageSentCallback.java
Wed Feb  1 11:27:41 2012
@@ -52,7 +52,7 @@ public class UseMessageIdAsCorrelationId
             newCorrelationID = message.getJMSMessageID();
         } catch (JMSException e) {
             // ignore
-            LOG.warn("Cannot get JMSMessageID from message: " + message, e);
+            LOG.warn("Cannot get JMSMessageID from message: " + message + ". This exception
will be ignored.", e);
         }
         if (newCorrelationID != null) {
             replyManager.updateCorrelationId(correlationId, newCorrelationID, requestTimeout);



Mime
View raw message