You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/11/13 11:23:32 UTC

[camel] 02/05: CAMEL-17190: camel-quickfix - Use ref counters to keep track on engine usage, and stop engine when no longer in use. And start if needed, such as manually stop a route and then later start it again.

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

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

commit b0ddb853caa4fc75ef9b2f818499c0a984075b58
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Nov 13 11:44:24 2021 +0100

    CAMEL-17190: camel-quickfix - Use ref counters to keep track on engine usage, and stop engine when no longer in use. And start if needed, such as manually stop a route and then later start it again.
---
 .../apache/camel/catalog/components/quickfix.json  |  4 +-
 .../quickfixj/QuickfixjEndpointConfigurer.java     |  4 +-
 .../apache/camel/component/quickfixj/quickfix.json |  4 +-
 .../component/quickfixj/QuickfixjComponent.java    | 11 +++-
 .../component/quickfixj/QuickfixjEndpoint.java     | 74 ++++++++++++++++------
 .../camel/component/quickfixj/QuickfixjEngine.java | 21 ++++--
 .../component/quickfixj/QuickfixjProducer.java     | 16 ++++-
 .../quickfixj/QuickfixjComponentTest.java          |  8 +--
 .../component/quickfixj/QuickfixjProducerTest.java |  2 +-
 .../dsl/QuickfixjEndpointBuilderFactory.java       | 69 +++-----------------
 10 files changed, 113 insertions(+), 100 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/quickfix.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/quickfix.json
index 3d7ad38..09798ed 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/quickfix.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/quickfix.json
@@ -32,8 +32,8 @@
   },
   "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 to create 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 s [...]
-    "sessionID": { "kind": "parameter", "displayName": "Session ID", "group": "common", "label": "", "required": false, "type": "object", "javaType": "quickfix.SessionID", "deprecated": false, "autowired": false, "secret": false, "description": "The optional sessionID identifies a specific FIX session. The format of the sessionID is: (BeginString):(SenderCompID)\/(SenderSubID)\/(SenderLocationID)-(TargetCompID)\/(TargetSubID)\/(TargetLocationID)" },
+    "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 [...]
+    "sessionID": { "kind": "parameter", "displayName": "Session ID", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The optional sessionID identifies a specific FIX session. The format of the sessionID is: (BeginString):(SenderCompID)\/(SenderSubID)\/(SenderLocationID)-(TargetCompID)\/(TargetSubID)\/(TargetLocationID)" },
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
     "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
diff --git a/components/camel-quickfix/src/generated/java/org/apache/camel/component/quickfixj/QuickfixjEndpointConfigurer.java b/components/camel-quickfix/src/generated/java/org/apache/camel/component/quickfixj/QuickfixjEndpointConfigurer.java
index 41853af..6db203c 100644
--- a/components/camel-quickfix/src/generated/java/org/apache/camel/component/quickfixj/QuickfixjEndpointConfigurer.java
+++ b/components/camel-quickfix/src/generated/java/org/apache/camel/component/quickfixj/QuickfixjEndpointConfigurer.java
@@ -32,7 +32,7 @@ public class QuickfixjEndpointConfigurer extends PropertyConfigurerSupport imple
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "sessionid":
-        case "sessionID": target.setSessionID(property(camelContext, quickfix.SessionID.class, value)); return true;
+        case "sessionID": target.setSessionID(property(camelContext, java.lang.String.class, value)); return true;
         default: return false;
         }
     }
@@ -51,7 +51,7 @@ public class QuickfixjEndpointConfigurer extends PropertyConfigurerSupport imple
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "sessionid":
-        case "sessionID": return quickfix.SessionID.class;
+        case "sessionID": return java.lang.String.class;
         default: return null;
         }
     }
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 3d7ad38..09798ed 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
@@ -32,8 +32,8 @@
   },
   "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 to create 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 s [...]
-    "sessionID": { "kind": "parameter", "displayName": "Session ID", "group": "common", "label": "", "required": false, "type": "object", "javaType": "quickfix.SessionID", "deprecated": false, "autowired": false, "secret": false, "description": "The optional sessionID identifies a specific FIX session. The format of the sessionID is: (BeginString):(SenderCompID)\/(SenderSubID)\/(SenderLocationID)-(TargetCompID)\/(TargetSubID)\/(TargetLocationID)" },
+    "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 [...]
+    "sessionID": { "kind": "parameter", "displayName": "Session ID", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The optional sessionID identifies a specific FIX session. The format of the sessionID is: (BeginString):(SenderCompID)\/(SenderSubID)\/(SenderLocationID)-(TargetCompID)\/(TargetSubID)\/(TargetLocationID)" },
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
     "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
diff --git a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
index 318341e..66afb63 100644
--- a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
+++ b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
@@ -26,6 +26,7 @@ import org.apache.camel.StartupListener;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.support.service.ServiceHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import quickfix.LogFactory;
@@ -144,7 +145,7 @@ public class QuickfixjComponent extends DefaultComponent implements StartupListe
     private void startQuickfixjEngine(QuickfixjEngine engine) {
         if (!engine.isLazy()) {
             LOG.info("Starting QuickFIX/J engine: {}", engine.getUri());
-            engine.start();
+            ServiceHelper.startService(engine);
         } else {
             LOG.info("QuickFIX/J engine: {} will start lazily", engine.getUri());
         }
@@ -229,4 +230,12 @@ public class QuickfixjComponent extends DefaultComponent implements StartupListe
             provisionalEngines.clear();
         }
     }
+
+    public void ensureEngineStarted(QuickfixjEngine engine) {
+        // only start engine after provisional engines is no longer in use
+        // as they are used for holding created engines during bootstrap of Camel
+        if (provisionalEngines.isEmpty()) {
+            ServiceHelper.startService(engine);
+        }
+    }
 }
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 41eb763..3851fac 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
@@ -33,6 +33,7 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.service.ServiceHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import quickfix.Message;
@@ -58,7 +59,8 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
     @Metadata(required = true)
     private String configurationName;
     @UriParam
-    private SessionID sessionID;
+    private String sessionID;
+    private volatile SessionID sid;
     @UriParam
     private boolean lazyCreateEngine;
 
@@ -67,16 +69,26 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
         this.engine = engine;
     }
 
-    public SessionID getSessionID() {
+    @Override
+    public QuickfixjComponent getComponent() {
+        return (QuickfixjComponent) super.getComponent();
+    }
+
+    public String getSessionID() {
         return sessionID;
     }
 
+    public SessionID getSID() {
+        return sid;
+    }
+
     /**
      * The optional sessionID identifies a specific FIX session. The format of the sessionID is:
      * (BeginString):(SenderCompID)[/(SenderSubID)[/(SenderLocationID)]]->(TargetCompID)[/(TargetSubID)[/(TargetLocationID)]]
      */
-    public void setSessionID(SessionID sessionID) {
+    public void setSessionID(String sessionID) {
         this.sessionID = sessionID;
+        this.sid = new SessionID(sessionID);
     }
 
     public String getConfigurationName() {
@@ -100,7 +112,7 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
     }
 
     /**
-     * This option allows to create QuickFIX/J engine on demand. Value true means the engine is started when first
+     * 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
      * started at the endpoint creation. When this parameter is missing, the value of component's property
      * lazyCreateEngines is being used.
@@ -129,10 +141,30 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
 
     protected void addConsumer(QuickfixjConsumer consumer) {
         consumers.add(consumer);
+        engine.incRefCount();
+        getComponent().ensureEngineStarted(engine);
     }
 
     protected void removeConsumer(QuickfixjConsumer consumer) {
         consumers.remove(consumer);
+        int count = engine.decRefCount();
+        if (count <= 0) {
+            LOG.info("Stopping QuickFIX/J Engine: {} no longer active in use", engine.getUri());
+            ServiceHelper.stopService(engine);
+        }
+    }
+
+    protected void addProducer(QuickfixjProducer producer) {
+        engine.incRefCount();
+        getComponent().ensureEngineStarted(engine);
+    }
+
+    protected void removeProducer(QuickfixjProducer producer) {
+        int count = engine.decRefCount();
+        if (count <= 0) {
+            LOG.info("Stopping QuickFIX/J Engine: {} no longer active in use", engine.getUri());
+            ServiceHelper.stopService(engine);
+        }
     }
 
     @Override
@@ -155,16 +187,16 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
     }
 
     private boolean isMatching(SessionID sessionID) {
-        if (this.sessionID.equals(sessionID)) {
+        if (this.sid.equals(sessionID)) {
             return true;
         }
-        return isMatching(this.sessionID.getBeginString(), sessionID.getBeginString())
-                && isMatching(this.sessionID.getSenderCompID(), sessionID.getSenderCompID())
-                && isMatching(this.sessionID.getSenderSubID(), sessionID.getSenderSubID())
-                && isMatching(this.sessionID.getSenderLocationID(), sessionID.getSenderLocationID())
-                && isMatching(this.sessionID.getTargetCompID(), sessionID.getTargetCompID())
-                && isMatching(this.sessionID.getTargetSubID(), sessionID.getTargetSubID())
-                && isMatching(this.sessionID.getTargetLocationID(), sessionID.getTargetLocationID());
+        return isMatching(this.sid.getBeginString(), sessionID.getBeginString())
+                && isMatching(this.sid.getSenderCompID(), sessionID.getSenderCompID())
+                && isMatching(this.sid.getSenderSubID(), sessionID.getSenderSubID())
+                && isMatching(this.sid.getSenderLocationID(), sessionID.getSenderLocationID())
+                && isMatching(this.sid.getTargetCompID(), sessionID.getTargetCompID())
+                && isMatching(this.sid.getTargetSubID(), sessionID.getTargetSubID())
+                && isMatching(this.sid.getTargetLocationID(), sessionID.getTargetLocationID());
     }
 
     private boolean isMatching(String s1, String s2) {
@@ -172,16 +204,16 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
     }
 
     private boolean isWildcarded() {
-        if (sessionID == null) {
+        if (sid == null) {
             return false;
         }
-        return sessionID.getBeginString().equals("*")
-                || sessionID.getSenderCompID().equals("*")
-                || sessionID.getSenderSubID().equals("*")
-                || sessionID.getSenderLocationID().equals("*")
-                || sessionID.getTargetCompID().equals("*")
-                || sessionID.getTargetSubID().equals("*")
-                || sessionID.getTargetLocationID().equals("*");
+        return sid.getBeginString().equals("*")
+                || sid.getSenderCompID().equals("*")
+                || sid.getSenderSubID().equals("*")
+                || sid.getSenderLocationID().equals("*")
+                || sid.getTargetCompID().equals("*")
+                || sid.getTargetSubID().equals("*")
+                || sid.getTargetLocationID().equals("*");
     }
 
     @Override
@@ -197,7 +229,7 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
             synchronized (engine) {
                 if (!engine.isInitialized()) {
                     engine.initializeEngine();
-                    engine.start();
+                    ServiceHelper.startService(engine);
                 }
             }
         }
diff --git a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
index a00cba8..0e7ec75 100644
--- a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
+++ b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.management.JMException;
 import javax.management.ObjectName;
@@ -30,6 +31,7 @@ import javax.management.ObjectName;
 import org.apache.camel.CamelContext;
 import org.apache.camel.support.ResourceHelper;
 import org.apache.camel.support.service.ServiceSupport;
+import org.apache.camel.util.URISupport;
 import org.quickfixj.jmx.JmxExporter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -100,6 +102,7 @@ public class QuickfixjEngine extends ServiceSupport {
     private final SessionSettings settings;
     private final AtomicBoolean initialized = new AtomicBoolean();
     private final boolean lazy;
+    private final AtomicInteger refCount = new AtomicInteger();
 
     public enum ThreadModel {
         ThreadPerConnector,
@@ -134,7 +137,7 @@ public class QuickfixjEngine extends ServiceSupport {
                            boolean lazy) throws Exception {
         addEventListener(messageCorrelator);
 
-        this.uri = uri;
+        this.uri = URISupport.sanitizeUri(uri);
         this.lazy = lazy;
         this.settings = settings;
 
@@ -154,6 +157,14 @@ public class QuickfixjEngine extends ServiceSupport {
         }
     }
 
+    public int incRefCount() {
+        return refCount.incrementAndGet();
+    }
+
+    public int decRefCount() {
+        return refCount.decrementAndGet();
+    }
+
     /**
      * Initializes the engine on demand. May be called immediately in constructor or when needed. If initializing later,
      * it should be started afterwards.
@@ -162,7 +173,7 @@ public class QuickfixjEngine extends ServiceSupport {
             throws ConfigError,
             FieldConvertError, JMException {
 
-        LOG.debug("Initializing QuickFIX/J Engine");
+        LOG.debug("Initializing QuickFIX/J Engine: {}", uri);
 
         if (messageFactory == null) {
             messageFactory = new DefaultMessageFactory();
@@ -227,7 +238,7 @@ public class QuickfixjEngine extends ServiceSupport {
             Thread.currentThread().setContextClassLoader(ccl);
         }
 
-        LOG.debug("Initialized QuickFIX/J Engine acceptor: {}, initiator: {}", acceptor, initiator);
+        LOG.debug("Initialized QuickFIX/J Engine: {}", uri);
         initialized.set(true);
     }
 
@@ -238,7 +249,7 @@ public class QuickfixjEngine extends ServiceSupport {
 
     @Override
     protected void doStart() throws Exception {
-        LOG.debug("Starting QuickFIX/J Engine acceptor: {}, initiator: {}", acceptor, initiator);
+        LOG.debug("Starting QuickFIX/J Engine: {}", uri);
 
         if (acceptor != null) {
             acceptor.start();
@@ -256,7 +267,7 @@ public class QuickfixjEngine extends ServiceSupport {
 
     @Override
     protected void doStop() throws Exception {
-        LOG.debug("Stopping QuickFIX/J Engine acceptor: {}, initiator: {}", acceptor, initiator);
+        LOG.debug("Stopping QuickFIX/J Engine: {}", uri);
 
         if (acceptor != null) {
             acceptor.stop();
diff --git a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
index 59c363a..8738792 100644
--- a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
+++ b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
@@ -44,6 +44,18 @@ public class QuickfixjProducer extends DefaultProducer {
     }
 
     @Override
+    protected void doStart() throws Exception {
+        getEndpoint().addProducer(this);
+        super.doStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        getEndpoint().removeProducer(this);
+        super.doStop();
+    }
+
+    @Override
     public void process(Exchange exchange) throws Exception {
         try {
             getEndpoint().ensureInitialized();
@@ -57,7 +69,7 @@ public class QuickfixjProducer extends DefaultProducer {
         Message message = camelMessage.getBody(Message.class);
         LOG.debug("Sending FIX message: {}", message);
 
-        SessionID messageSessionID = getEndpoint().getSessionID();
+        SessionID messageSessionID = getEndpoint().getSID();
         if (messageSessionID == null) {
             messageSessionID = MessageUtils.getSessionID(message);
         }
@@ -71,7 +83,7 @@ public class QuickfixjProducer extends DefaultProducer {
 
         if (exchange.getPattern().isOutCapable()) {
             MessageCorrelator messageCorrelator = getEndpoint().getEngine().getMessageCorrelator();
-            callable = messageCorrelator.getReply(getEndpoint().getSessionID(), exchange);
+            callable = messageCorrelator.getReply(getEndpoint().getSID(), exchange);
         }
 
         if (!session.send(message)) {
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java
index bc8857c..97659c4 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java
@@ -173,7 +173,7 @@ public class QuickfixjComponentTest {
         assertThat(component.getProvisionalEngines().get(settingsFile.getName()).isInitialized(), is(true));
         assertThat(component.getProvisionalEngines().get(settingsFile.getName()).isStarted(), is(false));
         assertThat(component.getEngines().size(), is(0));
-        assertThat(((QuickfixjEndpoint) e1).getSessionID(), is(nullValue()));
+        assertThat(((QuickfixjEndpoint) e1).getSID(), is(nullValue()));
 
         writeSettings(settings, false);
 
@@ -184,7 +184,7 @@ public class QuickfixjComponentTest {
         assertThat(component.getProvisionalEngines().get(settingsFile.getName()).isInitialized(), is(true));
         assertThat(component.getProvisionalEngines().get(settingsFile.getName()).isStarted(), is(false));
         assertThat(component.getEngines().size(), is(0));
-        assertThat(((QuickfixjEndpoint) e2).getSessionID(), is(nullValue()));
+        assertThat(((QuickfixjEndpoint) e2).getSID(), is(nullValue()));
 
         // will start the component
         camelContext.start();
@@ -219,7 +219,7 @@ public class QuickfixjComponentTest {
         assertThat(component.getEngines().get(settingsFile.getName()).isInitialized(), is(true));
         assertThat(component.getEngines().get(settingsFile.getName()).isStarted(), is(true));
         assertThat(component.getProvisionalEngines().size(), is(0));
-        assertThat(((QuickfixjEndpoint) e1).getSessionID(), is(nullValue()));
+        assertThat(((QuickfixjEndpoint) e1).getSID(), is(nullValue()));
 
         Endpoint e2 = component.createEndpoint(getEndpointUri(settingsFile.getName(), sessionID));
         assertThat(component.getEngines().size(), is(1));
@@ -227,7 +227,7 @@ public class QuickfixjComponentTest {
         assertThat(component.getEngines().get(settingsFile.getName()).isInitialized(), is(true));
         assertThat(component.getEngines().get(settingsFile.getName()).isStarted(), is(true));
         assertThat(component.getProvisionalEngines().size(), is(0));
-        assertThat(((QuickfixjEndpoint) e2).getSessionID(), is(sessionID));
+        assertThat(((QuickfixjEndpoint) e2).getSID(), is(sessionID));
     }
 
     @Test
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
index f783ca6..ff084b6 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
@@ -70,7 +70,7 @@ public class QuickfixjProducerTest {
 
         Mockito.when(mockCamelMessage.getBody(Message.class)).thenReturn(inboundFixMessage);
 
-        Mockito.when(mockEndpoint.getSessionID()).thenReturn(sessionID);
+        Mockito.when(mockEndpoint.getSID()).thenReturn(sessionID);
 
         producer = Mockito.spy(new QuickfixjProducer(mockEndpoint));
     }
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QuickfixjEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QuickfixjEndpointBuilderFactory.java
index a97c3e6..8ff6026 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QuickfixjEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QuickfixjEndpointBuilderFactory.java
@@ -43,7 +43,7 @@ public interface QuickfixjEndpointBuilderFactory {
             return (AdvancedQuickfixjEndpointConsumerBuilder) this;
         }
         /**
-         * This option allows to create QuickFIX/J engine on demand. Value true
+         * 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 started at the endpoint creation. When this parameter
@@ -64,7 +64,7 @@ public interface QuickfixjEndpointBuilderFactory {
             return this;
         }
         /**
-         * This option allows to create QuickFIX/J engine on demand. Value true
+         * 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 started at the endpoint creation. When this parameter
@@ -90,24 +90,7 @@ public interface QuickfixjEndpointBuilderFactory {
          * of the sessionID is:
          * (BeginString):(SenderCompID)/(SenderSubID)/(SenderLocationID)-(TargetCompID)/(TargetSubID)/(TargetLocationID).
          * 
-         * The option is a: &lt;code&gt;quickfix.SessionID&lt;/code&gt; type.
-         * 
-         * Group: common
-         * 
-         * @param sessionID the value to set
-         * @return the dsl builder
-         */
-        default QuickfixjEndpointConsumerBuilder sessionID(Object sessionID) {
-            doSetProperty("sessionID", sessionID);
-            return this;
-        }
-        /**
-         * The optional sessionID identifies a specific FIX session. The format
-         * of the sessionID is:
-         * (BeginString):(SenderCompID)/(SenderSubID)/(SenderLocationID)-(TargetCompID)/(TargetSubID)/(TargetLocationID).
-         * 
-         * The option will be converted to a
-         * &lt;code&gt;quickfix.SessionID&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: common
          * 
@@ -256,7 +239,7 @@ public interface QuickfixjEndpointBuilderFactory {
             return (AdvancedQuickfixjEndpointProducerBuilder) this;
         }
         /**
-         * This option allows to create QuickFIX/J engine on demand. Value true
+         * 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 started at the endpoint creation. When this parameter
@@ -277,7 +260,7 @@ public interface QuickfixjEndpointBuilderFactory {
             return this;
         }
         /**
-         * This option allows to create QuickFIX/J engine on demand. Value true
+         * 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 started at the endpoint creation. When this parameter
@@ -303,24 +286,7 @@ public interface QuickfixjEndpointBuilderFactory {
          * of the sessionID is:
          * (BeginString):(SenderCompID)/(SenderSubID)/(SenderLocationID)-(TargetCompID)/(TargetSubID)/(TargetLocationID).
          * 
-         * The option is a: &lt;code&gt;quickfix.SessionID&lt;/code&gt; type.
-         * 
-         * Group: common
-         * 
-         * @param sessionID the value to set
-         * @return the dsl builder
-         */
-        default QuickfixjEndpointProducerBuilder sessionID(Object sessionID) {
-            doSetProperty("sessionID", sessionID);
-            return this;
-        }
-        /**
-         * The optional sessionID identifies a specific FIX session. The format
-         * of the sessionID is:
-         * (BeginString):(SenderCompID)/(SenderSubID)/(SenderLocationID)-(TargetCompID)/(TargetSubID)/(TargetLocationID).
-         * 
-         * The option will be converted to a
-         * &lt;code&gt;quickfix.SessionID&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: common
          * 
@@ -404,7 +370,7 @@ public interface QuickfixjEndpointBuilderFactory {
             return (AdvancedQuickfixjEndpointBuilder) this;
         }
         /**
-         * This option allows to create QuickFIX/J engine on demand. Value true
+         * 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 started at the endpoint creation. When this parameter
@@ -425,7 +391,7 @@ public interface QuickfixjEndpointBuilderFactory {
             return this;
         }
         /**
-         * This option allows to create QuickFIX/J engine on demand. Value true
+         * 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 started at the endpoint creation. When this parameter
@@ -451,24 +417,7 @@ public interface QuickfixjEndpointBuilderFactory {
          * of the sessionID is:
          * (BeginString):(SenderCompID)/(SenderSubID)/(SenderLocationID)-(TargetCompID)/(TargetSubID)/(TargetLocationID).
          * 
-         * The option is a: &lt;code&gt;quickfix.SessionID&lt;/code&gt; type.
-         * 
-         * Group: common
-         * 
-         * @param sessionID the value to set
-         * @return the dsl builder
-         */
-        default QuickfixjEndpointBuilder sessionID(Object sessionID) {
-            doSetProperty("sessionID", sessionID);
-            return this;
-        }
-        /**
-         * The optional sessionID identifies a specific FIX session. The format
-         * of the sessionID is:
-         * (BeginString):(SenderCompID)/(SenderSubID)/(SenderLocationID)-(TargetCompID)/(TargetSubID)/(TargetLocationID).
-         * 
-         * The option will be converted to a
-         * &lt;code&gt;quickfix.SessionID&lt;/code&gt; type.
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
          * 
          * Group: common
          *