This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.20.x by this push:
     new 206cd44  CAMEL-12659: Don't log error message when HL7 Header 
population is disabled
206cd44 is described below

commit 206cd448c8405a7077cbeb27e4fd3be260910633
Author: Quinn Stevenson <qu...@apache.org>
AuthorDate: Tue Jul 17 13:46:38 2018 -0600

    CAMEL-12659: Don't log error message when HL7 Header population is disabled
---
 .../org/apache/camel/component/mllp/MllpTcpServerConsumer.java    | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpTcpServerConsumer.java
 
b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpTcpServerConsumer.java
index d036944..a2d4903 100644
--- 
a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpTcpServerConsumer.java
+++ 
b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpTcpServerConsumer.java
@@ -664,7 +664,7 @@ public class MllpTcpServerConsumer extends DefaultConsumer {
         }
 
         private void populateHl7DataHeaders(Exchange exchange, Message 
message, byte[] hl7MessageBytes) {
-            if (hl7MessageBytes == null ||  hl7MessageBytes.length < 8) {
+            if (!endpoint.hl7Headers || hl7MessageBytes == null ||  
hl7MessageBytes.length < 8) {
                 // Not enough data to populate anything - just return
                 return;
             }
@@ -689,8 +689,8 @@ public class MllpTcpServerConsumer extends DefaultConsumer {
             String messageBodyForDebugging = new String(hl7MessageBytes);
             if (-1 == endOfMSH) {
                 // TODO:  May want to throw some sort of an Exception here
-                log.error("Population of message headers failed - unable to 
find the end of the MSH segment");
-            } else if (endpoint.hl7Headers) {
+                log.warn("Population of message headers failed - unable to 
find the end of the MSH segment");
+            } else {
                 log.debug("Populating the HL7 message headers");
                 Charset charset = 
Charset.forName(IOHelper.getCharsetName(exchange));
 
@@ -757,8 +757,6 @@ public class MllpTcpServerConsumer extends DefaultConsumer {
                         }
                     }
                 }
-            } else {
-                log.trace("HL7 Message headers disabled");
             }
 
         }

Reply via email to