camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1199138 - in /camel/branches/camel-2.8.x: ./ components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
Date Tue, 08 Nov 2011 07:35:24 GMT
Author: davsclaus
Date: Tue Nov  8 07:35:24 2011
New Revision: 1199138

URL: http://svn.apache.org/viewvc?rev=1199138&view=rev
Log:
CAMEL-4642: Do not print JMS message in toString, to avoid printing details from the JMS message
in logs etc.

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 07:35:24 2011
@@ -1 +1 @@
-/camel/trunk:1186106,1186625,1186772,1187221,1187485,1187882,1187893,1188070-1188085,1188642,1188674,1188879,1188881,1189139,1189600,1189681,1189693,1189737,1190212-1190213,1190246,1190303,1195317,1195616,1196210,1197450,1197933,1197948,1198199,1198338,1198340,1199123
+/camel/trunk:1186106,1186625,1186772,1187221,1187485,1187882,1187893,1188070-1188085,1188642,1188674,1188879,1188881,1189139,1189600,1189681,1189693,1189737,1190212-1190213,1190246,1190303,1195317,1195616,1196210,1197450,1197933,1197948,1198199,1198338,1198340,1199123,1199137

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java?rev=1199138&r1=1199137&r2=1199138&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
(original)
+++ camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
Tue Nov  8 07:35:24 2011
@@ -27,6 +27,7 @@ import javax.jms.Topic;
 import org.apache.camel.RuntimeExchangeException;
 import org.apache.camel.impl.DefaultMessage;
 import org.apache.camel.util.ExchangeHelper;
+import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,11 +48,15 @@ public class JmsMessage extends DefaultM
 
     @Override
     public String toString() {
+        // do not print jmsMessage as there could be sensitive details
         if (jmsMessage != null) {
-            return "JmsMessage: " + jmsMessage;
-        } else {
-            return "JmsMessage: " + getBody();
+            try {
+                return "JmsMessage[JmsMessageID: " + jmsMessage.getJMSMessageID() + "]";
+            } catch (Throwable e) {
+                // ignore
+            }
         }
+        return "JmsMessage@" + ObjectHelper.getIdentityHashCode(this);
     }
 
     @Override



Mime
View raw message