This is an automated email from the ASF dual-hosted git repository. nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers in repository https://gitbox.apache.org/repos/asf/camel.git
commit 5cc3870a612933eca52aadd5a557a35e93927323 Author: Nicolas Filotto <[email protected]> AuthorDate: Thu Mar 31 16:28:08 2022 +0200 CAMEL-17792: Add doc about the message headers of camel-mllp --- .../org/apache/camel/component/mllp/mllp.json | 20 +++++++++ .../camel-mllp/src/main/docs/mllp-component.adoc | 45 ++------------------- .../apache/camel/component/mllp/MllpConstants.java | 47 +++++++++++++++------- .../apache/camel/component/mllp/MllpEndpoint.java | 3 +- 4 files changed, 58 insertions(+), 57 deletions(-) diff --git a/components/camel-mllp/src/generated/resources/org/apache/camel/component/mllp/mllp.json b/components/camel-mllp/src/generated/resources/org/apache/camel/component/mllp/mllp.json index 7dbe33a..e0a51af 100644 --- a/components/camel-mllp/src/generated/resources/org/apache/camel/component/mllp/mllp.json +++ b/components/camel-mllp/src/generated/resources/org/apache/camel/component/mllp/mllp.json @@ -53,6 +53,26 @@ "sendBufferSize": { "kind": "property", "displayName": "Send Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "8192", "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Sets the SO_SNDBUF option to the specified value (in bytes)" }, "idleTimeout": { "kind": "property", "displayName": "Idle Timeout", "group": "tcp", "label": "advanced,tcp", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "The approximate idle time allowed before the Client TCP Connection will be reset. A null value or a value less than or e [...] }, + "headers": { + "CamelMllpLocalAddress": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The local TCP Address of the Socket" }, + "CamelMllpRemoteAddress": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The remote TCP Address of the Socket" }, + "CamelMllpAcknowledgement": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HL7 Acknowledgment received in bytes" }, + "CamelMllpAcknowledgementString": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HL7 Acknowledgment received, converted to a String" }, + "CamelMllpAcknowledgementType": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HL7 acknowledgement type (AA, AE, AR, etc)" }, + "CamelMllpSendingApplication": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-3 value" }, + "CamelMllpSendingFacility": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-4 value" }, + "CamelMllpReceivingApplication": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-5 value" }, + "CamelMllpReceivingFacility": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-6 value" }, + "CamelMllpTimestamp": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-7 value" }, + "CamelMllpSecurity": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-8 value" }, + "CamelMllpMessageType": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-9 value" }, + "CamelMllpEventType": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-9.1 value" }, + "CamelMllpTriggerEvent": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-9.2 value" }, + "CamelMllpMessageControlId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-10 value" }, + "CamelMllpProcessingId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-11 value" }, + "CamelMllpVersionId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-12 value" }, + "CamelMllpCharset": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "MSH-18 value" } + }, "properties": { "hostname": { "kind": "path", "displayName": "Hostname", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Hostname or IP for connection for the TCP connection. The default value is null, which means any local IP address" }, "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": true, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Port number for the TCP connection" }, diff --git a/components/camel-mllp/src/main/docs/mllp-component.adoc b/components/camel-mllp/src/main/docs/mllp-component.adoc index 98a5231..0bb1e46 100644 --- a/components/camel-mllp/src/main/docs/mllp-component.adoc +++ b/components/camel-mllp/src/main/docs/mllp-component.adoc @@ -60,7 +60,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: START // endpoint options: END - +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == MLLP Consumer @@ -74,33 +76,6 @@ the CamelMllpAcknowledgementType exchange property. The MLLP Consumer can read messages without sending any HL7 Acknowledgement if the automatic acknowledgement is disabled and exchange pattern is InOnly. -=== Message Headers - -The MLLP Consumer adds these headers on the Camel message: - -[width="100%",cols="<34%,<33%,<33%",] -|=========================================== -|*Key* |*Description* | -|CamelMllpLocalAddress | The local TCP Address of the Socket | -|CamelMllpRemoteAddress | The local TCP Address of the Socket | -|CamelMllpSendingApplication | MSH-3 value | -|CamelMllpSendingFacility | MSH-4 value | -|CamelMllpReceivingApplication | MSH-5 value | -|CamelMllpReceivingFacility | MSH-6 value | -|CamelMllpTimestamp | MSH-7 value | -|CamelMllpSecurity | MSH-8 value | -|CamelMllpMessageType | MSH-9 value | -|CamelMllpEventType | MSH-9-1 value | -|CamelMllpTriggerEvent | MSH-9-2 value | -|CamelMllpMessageControlId | MSH-10 value | -|CamelMllpProcessingId | MSH-11 value | -|CamelMllpVersionId | MSH-12 value | -|CamelMllpCharset | MSH-18 value | -|=========================================== - -All headers are String types. If a header value is missing, its value -is null. - === Exchange Properties The type of acknowledgment the MLLP Consumer generates and state of the TCP Socket can be controlled @@ -130,20 +105,6 @@ received. The received acknowledgement is interrogated and an exception is raised in the event of a negative acknowledgement. The MLLP Producer can ignore acknowledgements when configured with InOnly exchange pattern. -=== Message Headers - -The MLLP Producer adds these headers on the Camel message: - -[width="100%",cols="<34%,<33%,<33%",] -|=================================== -|*Key* |*Description* | -|CamelMllpLocalAddress | The local TCP Address of the Socket | -|CamelMllpRemoteAddress | The remote TCP Address of the Socket | -|CamelMllpAcknowledgement | The HL7 Acknowledgment byte[] received | -|CamelMllpAcknowledgementString | The HL7 Acknowledgment received, converted to a String | -|CamelMllpAcknowledgementType | The HL7 acknowledgement type (AA, AE, AR, etc) -|=================================== - === Exchange Properties The state of the TCP Socket can be controlled by these properties on the Camel exchange: diff --git a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConstants.java b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConstants.java index 0efc03d..00eede0 100644 --- a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConstants.java +++ b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConstants.java @@ -16,15 +16,21 @@ */ package org.apache.camel.component.mllp; +import org.apache.camel.spi.Metadata; + /** * Constants for the MLLP Protocol and the Camel MLLP component. */ public final class MllpConstants { + @Metadata(description = "The local TCP Address of the Socket", javaType = "String") public static final String MLLP_LOCAL_ADDRESS = "CamelMllpLocalAddress"; + @Metadata(description = "The remote TCP Address of the Socket", javaType = "String") public static final String MLLP_REMOTE_ADDRESS = "CamelMllpRemoteAddress"; - + @Metadata(description = "The HL7 Acknowledgment received in bytes", javaType = "byte[]") public static final String MLLP_ACKNOWLEDGEMENT = "CamelMllpAcknowledgement"; + @Metadata(description = "The HL7 Acknowledgment received, converted to a String", javaType = "String") public static final String MLLP_ACKNOWLEDGEMENT_STRING = "CamelMllpAcknowledgementString"; + @Metadata(description = "The HL7 acknowledgement type (AA, AE, AR, etc)", javaType = "String") public static final String MLLP_ACKNOWLEDGEMENT_TYPE = "CamelMllpAcknowledgementType"; public static final String MLLP_ACKNOWLEDGEMENT_MSA_TEXT = "CamelMllpAcknowledgementMsaText"; @@ -40,31 +46,44 @@ public final class MllpConstants { public static final String MLLP_CLOSE_CONNECTION_AFTER_SEND = "CamelMllpCloseConnectionAfterSend"; public static final String MLLP_RESET_CONNECTION_AFTER_SEND = "CamelMllpResetConnectionAfterSend"; - // MSH-3 + /** MSH-3 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_SENDING_APPLICATION = "CamelMllpSendingApplication"; - // MSH-4 + /** MSH-4 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_SENDING_FACILITY = "CamelMllpSendingFacility"; - // MSH-5 + /** MSH-5 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_RECEIVING_APPLICATION = "CamelMllpReceivingApplication"; - // MSH-6 + /** MSH-6 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_RECEIVING_FACILITY = "CamelMllpReceivingFacility"; - // MSH-7 + /** MSH-7 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_TIMESTAMP = "CamelMllpTimestamp"; - // MSH-8 + /** MSH-8 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_SECURITY = "CamelMllpSecurity"; - // MSH-9 + /** MSH-9 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_MESSAGE_TYPE = "CamelMllpMessageType"; - // MSH-9.1 + /** MSH-9.1 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_EVENT_TYPE = "CamelMllpEventType"; - // MSH-9.2 + /** MSH-9.2 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_TRIGGER_EVENT = "CamelMllpTriggerEvent"; - // MSH-10 + /** MSH-10 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_MESSAGE_CONTROL = "CamelMllpMessageControlId"; - // MSH-11 + /** MSH-11 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_PROCESSING_ID = "CamelMllpProcessingId"; - // MSH-12 + /** MSH-12 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_VERSION_ID = "CamelMllpVersionId"; - // MSH-18 + /** MSH-18 value */ + @Metadata(label = "consumer", javaType = "String") public static final String MLLP_CHARSET = "CamelMllpCharset"; private MllpConstants() { diff --git a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java index 55ecef6..99499f2 100644 --- a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java +++ b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java @@ -48,7 +48,8 @@ import org.slf4j.Logger; */ @ManagedResource(description = "MLLP Endpoint") @UriEndpoint(scheme = "mllp", firstVersion = "2.17.0", title = "MLLP", syntax = "mllp:hostname:port", - category = { Category.NETWORKING, Category.RPC, Category.MLLP }, generateConfigurer = true) + category = { Category.NETWORKING, Category.RPC, Category.MLLP }, generateConfigurer = true, + headersClass = MllpConstants.class) public class MllpEndpoint extends DefaultEndpoint { @UriPath
