You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/04/04 13:40:45 UTC

[camel] 08/08: CAMEL-17792: Add doc about the message headers of camel-quickfix

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 7d292156adbef116a5ba86ac3b3d712eba1efcb6
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Mon Apr 4 15:39:33 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-quickfix
---
 .../apache/camel/component/quickfixj/quickfix.json |  5 +++++
 .../src/main/docs/quickfix-component.adoc          | 25 +++-------------------
 .../component/quickfixj/QuickfixjConsumer.java     |  2 +-
 .../component/quickfixj/QuickfixjEndpoint.java     |  5 ++++-
 4 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/components/camel-quickfix/src/generated/resources/org/apache/camel/component/quickfixj/quickfix.json b/components/camel-quickfix/src/generated/resources/org/apache/camel/component/quickfixj/quickfix.json
index 6eeedc02861..3dd5bfd91e7 100644
--- a/components/camel-quickfix/src/generated/resources/org/apache/camel/component/quickfixj/quickfix.json
+++ b/components/camel-quickfix/src/generated/resources/org/apache/camel/component/quickfixj/quickfix.json
@@ -31,6 +31,11 @@
     "messageFactory": { "kind": "property", "displayName": "Message Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "quickfix.MessageFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use the given MessageFactory" },
     "messageStoreFactory": { "kind": "property", "displayName": "Message Store Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "quickfix.MessageStoreFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use the given MessageStoreFactory" }
   },
+  "headers": {
+    "EventCategory": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.apache.camel.component.quickfixj.QuickfixjEventCategory", "enum": [ "AppMessageReceived", "AppMessageSent", "AdminMessageReceived", "AdminMessageSent", "SessionCreated", "SessionLogon", "SessionLogoff" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The event category." },
+    "SessionID": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "quickfix.SessionID", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FIX message SessionID." },
+    "MessageType": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The FIX MsgType tag value." }
+  },
   "properties": {
     "configurationName": { "kind": "path", "displayName": "Configuration Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the quickfix configuration file. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the configuration file using these protocols (classpath is default). ref will lookup  [...]
     "lazyCreateEngine": { "kind": "parameter", "displayName": "Lazy Create Engine", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "This option allows creating QuickFIX\/J engine on demand. Value true means the engine is started when first message is send or there's consumer configured in route definition. When false value is used, the engine is st [...]
diff --git a/components/camel-quickfix/src/main/docs/quickfix-component.adoc b/components/camel-quickfix/src/main/docs/quickfix-component.adoc
index 57d56363a18..0cb2f36fb78 100644
--- a/components/camel-quickfix/src/main/docs/quickfix-component.adoc
+++ b/components/camel-quickfix/src/main/docs/quickfix-component.adoc
@@ -93,28 +93,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
-
-== Exchange Format
-
-The exchange headers include information to help with exchange
-filtering, routing and other processing. The following headers are
-available:
-
-[width="100%",cols="10%,90%",options="header",]
-|=======================================================================
-|Header Name |Description
-|EventCategory |One of `AppMessageReceived`, `AppMessageSent`,
-`AdminMessageReceived`, `AdminMessageSent`, `SessionCreated`,
-`SessionLogon`, `SessionLogoff`. See the `QuickfixjEventCategory` enum.
-
-|SessionID |The FIX message SessionID
-
-|MessageType |The FIX MsgType tag value
-
-|DataDictionary |Specifies a data dictionary to used for parsing an
-incoming message. Can be an instance of a data dictionary or a resource
-path for a QuickFIX/J data dictionary file
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 The DataDictionary header is useful if string messages are being
 received and need to be parsed in a route. QuickFIX/J requires a data
diff --git a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
index d97e35d98f4..bfbb9065736 100644
--- a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
+++ b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
@@ -73,7 +73,7 @@ public class QuickfixjConsumer extends DefaultConsumer {
 
         LOG.debug("Sending FIX message reply: {}", quickfixjMessage);
 
-        SessionID messageSessionID = exchange.getIn().getHeader("SessionID", SessionID.class);
+        SessionID messageSessionID = exchange.getIn().getHeader(QuickfixjEndpoint.SESSION_ID_KEY, SessionID.class);
 
         Session session = getSession(messageSessionID);
         if (session == null) {
diff --git a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
index 6dc74b431be..d750ed257e0 100644
--- a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
+++ b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
@@ -43,10 +43,13 @@ import quickfix.SessionID;
  * Open a Financial Interchange (FIX) session using an embedded QuickFix/J engine.
  */
 @UriEndpoint(firstVersion = "2.1.0", scheme = "quickfix", title = "QuickFix", syntax = "quickfix:configurationName",
-             category = { Category.MESSAGING })
+             category = { Category.MESSAGING }, headersClass = QuickfixjEndpoint.class)
 public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEventListener, MultipleConsumersSupport {
+    @Metadata(description = "The event category.", javaType = "org.apache.camel.component.quickfixj.QuickfixjEventCategory")
     public static final String EVENT_CATEGORY_KEY = "EventCategory";
+    @Metadata(description = "The FIX message SessionID.", javaType = "quickfix.SessionID")
     public static final String SESSION_ID_KEY = "SessionID";
+    @Metadata(description = "The FIX MsgType tag value.", javaType = "String")
     public static final String MESSAGE_TYPE_KEY = "MessageType";
     public static final String DATA_DICTIONARY_KEY = "DataDictionary";