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

quinn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 130a422  CAMEL-12659: Don't log error message when HL7 Headers 
population is disabled
130a422 is described below

commit 130a42223171a39cbe3d77021b2ecf15a21036f8
Author: Quinn Stevenson <qu...@apache.org>
AuthorDate: Tue Jul 17 11:18:12 2018 -0600

    CAMEL-12659: Don't log error message when HL7 Headers population is disabled
---
 .../apache/camel/component/mllp/MllpTcpServerConsumer.java    | 11 ++++++-----
 1 file changed, 6 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 dcd32d8..030fa47 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
@@ -290,7 +290,7 @@ public class MllpTcpServerConsumer extends DefaultConsumer {
 
 
     void populateHl7DataHeaders(Exchange exchange, Message message, byte[] 
hl7MessageBytes) {
-        if (exchange != null && exchange.getException() == null) {
+        if (getConfiguration().isHl7Headers() && exchange != null && 
exchange.getException() == null) {
             if (hl7MessageBytes == null || hl7MessageBytes.length < 8) {
                 // Not enough data to populate anything - just return
                 return;
@@ -315,8 +315,8 @@ public class MllpTcpServerConsumer extends DefaultConsumer {
 
             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 (getConfiguration().isHl7Headers()) {
+                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 = getConfiguration().getCharset(exchange);
 
@@ -384,10 +384,11 @@ public class MllpTcpServerConsumer extends 
DefaultConsumer {
                         }
                     }
                 }
-            } else {
-                log.trace("HL7 Message headers disabled");
             }
+        } else {
+            log.trace("HL7 Message headers disabled");
         }
+
     }
 
 

Reply via email to