This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new b75ed6c Setting custom MLLP ack using HL7 ack example b75ed6c is described below commit b75ed6c938c33dda7175a04aba3de649c163d911 Author: Martin Muzikar <46345469+mmuzi...@users.noreply.github.com> AuthorDate: Fri Sep 10 11:04:51 2021 +0200 Setting custom MLLP ack using HL7 ack example --- .../camel-hl7/src/main/docs/hl7terser-language.adoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/camel-hl7/src/main/docs/hl7terser-language.adoc b/components/camel-hl7/src/main/docs/hl7terser-language.adoc index 8f1ee2e..e9b32b6 100644 --- a/components/camel-hl7/src/main/docs/hl7terser-language.adoc +++ b/components/camel-hl7/src/main/docs/hl7terser-language.adoc @@ -138,4 +138,20 @@ from("direct:test1") .transform(ack()) ---- +=== Custom Acknowledgement for MLLP + +In particural situations you may want to set a custom acknowledgement without using Exceptions. +This can be achieved using the `ack` expression: + +[source,java] +---- +import org.apache.camel.component.mllp.MllpConstants; +import ca.uhn.hl7v2.AcknowledgmentCode; +import ca.uhn.hl7v2.ErrorCode; + +// In process block +exchange.setProperty(MllpConstants.MLLP_ACKNOWLEDGEMENT, + ack(AcknowledgmentCode.AR, "Server didn't accept this message", ErrorCode.UNKNOWN_KEY_IDENTIFIER).evaluate(exchange, Object.class) +---- + include::{page-component-version}@camel-spring-boot::page$hl7-starter.adoc[]