You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by qu...@apache.org on 2018/07/17 19:46:46 UTC

[camel] branch camel-2.20.x updated: CAMEL-12659: Don't log error message when HL7 Header population is disabled

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

quinn 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 b7281f1  CAMEL-12659: Don't log error message when HL7 Header population is disabled
b7281f1 is described below

commit b7281f1eda9c5a4dd7328c3e4d55142f45737a22
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");
             }
 
         }