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 2020/09/10 19:17:23 UTC

[camel] branch master updated: CAMEL-15497: camel-quickfix - Can now load quickfix configuration file from file/bean etc via resource loader in Camel.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new eecaef9  CAMEL-15497: camel-quickfix - Can now load quickfix configuration file from file/bean etc via resource loader in Camel.
eecaef9 is described below

commit eecaef90a743154937d8bbfbae4fab72cd4a8ab5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Sep 10 21:16:51 2020 +0200

    CAMEL-15497: camel-quickfix - Can now load quickfix configuration file from file/bean etc via resource loader in Camel.
---
 .../apache/camel/component/quickfixj/quickfix.json |  2 +-
 .../src/main/docs/quickfix-component.adoc          |  2 +-
 .../component/quickfixj/QuickfixjComponent.java    |  3 +-
 .../component/quickfixj/QuickfixjEndpoint.java     |  8 +-
 .../camel/component/quickfixj/QuickfixjEngine.java | 79 +++++---------------
 .../quickfixj/QuickfixjConvertersTest.java         |  7 +-
 .../component/quickfixj/QuickfixjEngineTest.java   | 51 +++++++------
 .../quickfixj/QuickfixjLazyProducerTest.java       | 87 ----------------------
 .../component/quickfixj/QuickfixjProducerTest.java | 12 ++-
 .../camel/component/quickfixj/TestSupport.java     | 11 ++-
 .../builder/endpoint/StaticEndpointBuilders.java   | 16 +++-
 .../dsl/QuickfixjEndpointBuilderFactory.java       | 16 +++-
 12 files changed, 95 insertions(+), 199 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 48c6628..5c389f7 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,7 +32,7 @@
     "messageStoreFactory": { "kind": "property", "displayName": "Message Store Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "quickfix.MessageStoreFactory", "deprecated": false, "secret": false, "description": "To use the given MessageStoreFactory" }
   },
   "properties": {
-    "configurationName": { "kind": "path", "displayName": "Configuration Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The configFile is the name of the QuickFIX\/J configuration to use for the FIX engine (located as a resource found in your classpath)." },
+    "configurationName": { "kind": "path", "displayName": "Configuration Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "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 the configuration fi [...]
     "lazyCreateEngine": { "kind": "parameter", "displayName": "Lazy Create Engine", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 started at the endpoi [...]
     "sessionID": { "kind": "parameter", "displayName": "Session ID", "group": "common", "label": "", "required": false, "type": "object", "javaType": "quickfix.SessionID", "deprecated": 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, "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 message and handled b [...]
diff --git a/components/camel-quickfix/src/main/docs/quickfix-component.adoc b/components/camel-quickfix/src/main/docs/quickfix-component.adoc
index 0397528..fc1412e 100644
--- a/components/camel-quickfix/src/main/docs/quickfix-component.adoc
+++ b/components/camel-quickfix/src/main/docs/quickfix-component.adoc
@@ -116,7 +116,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *configurationName* | *Required* The configFile is the name of the QuickFIX/J configuration to use for the FIX engine (located as a resource found in your classpath). |  | String
+| *configurationName* | *Required* 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 the configuration file in the registry. bean will call a method on a bean to be used as the configuration. For bean you can specify the method name after dot, eg bean:myBean.myMethod |  | String
 |===
 
 
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 7fe05a4..cf92c6e 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
@@ -81,7 +81,7 @@ public class QuickfixjComponent extends DefaultComponent implements StartupListe
                     if (configuration != null) {
                         settings = configuration.createSessionSettings();
                     } else {
-                        settings = QuickfixjEngine.loadSettings(remaining);
+                        settings = QuickfixjEngine.loadSettings(getCamelContext(), remaining);
                     }
                     Boolean lazyCreateEngineForEndpoint
                             = super.getAndRemoveParameter(parameters, PARAMETER_LAZY_CREATE_ENGINE, Boolean.TYPE);
@@ -89,6 +89,7 @@ public class QuickfixjComponent extends DefaultComponent implements StartupListe
                         lazyCreateEngineForEndpoint = isLazyCreateEngines();
                     }
                     engine = new QuickfixjEngine(
+                            getCamelContext(),
                             uri, settings, messageStoreFactory, logFactory, messageFactory,
                             lazyCreateEngineForEndpoint);
 
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 08b95e0..7725b0d 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
@@ -84,8 +84,12 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
     }
 
     /**
-     * The configFile is the name of the QuickFIX/J configuration to use for the FIX engine (located as a resource found
-     * in your classpath).
+     * Path to the quickfix configuration file.
+     * <p/>
+     * 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 the configuration file in the registry. bean will
+     * call a method on a bean to be used as the configuration. For bean you can specify the method name after dot, eg
+     * bean:myBean.myMethod
      */
     public void setConfigurationName(String configurationName) {
         this.configurationName = configurationName;
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 3d712bc..b2eb994 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
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.quickfixj;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -28,8 +27,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import javax.management.JMException;
 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.ObjectHelper;
 import org.quickfixj.jmx.JmxExporter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -106,70 +106,32 @@ public class QuickfixjEngine extends ServiceSupport {
         ThreadPerSession;
     }
 
-    /**
-     * @deprecated Better make use of the {@link #QuickfixjEngine(String, String)} constructor as the
-     *             {@code forcedShutdown} paramater had/has no effect.
-     */
-    @Deprecated
-    public QuickfixjEngine(String uri, String settingsResourceName, boolean forcedShutdown)
-                                                                                            throws ConfigError,
-                                                                                            FieldConvertError, IOException,
-                                                                                            JMException {
-
-        this(uri, settingsResourceName, forcedShutdown, null, null, null);
-    }
-
-    public QuickfixjEngine(String uri, String settingsResourceName) throws ConfigError, FieldConvertError, IOException,
-                                                                    JMException {
-        this(uri, settingsResourceName, null, null, null);
-    }
-
-    /**
-     * @deprecated Better make use of the
-     *             {@link #QuickfixjEngine(String, String, MessageStoreFactory, LogFactory, MessageFactory)} constructor
-     *             as the {@code forcedShutdown} paramater had/has no effect.
-     */
-    @Deprecated
-    public QuickfixjEngine(String uri, String settingsResourceName, boolean forcedShutdown,
-                           MessageStoreFactory messageStoreFactoryOverride, LogFactory sessionLogFactoryOverride,
-                           MessageFactory messageFactoryOverride) throws ConfigError, FieldConvertError, IOException,
-                                                                  JMException {
-        this(uri, loadSettings(settingsResourceName), forcedShutdown, messageStoreFactoryOverride,
-             sessionLogFactoryOverride, messageFactoryOverride);
+    public QuickfixjEngine(CamelContext camelContext, String uri, String settingsResourceName) throws Exception {
+        this(camelContext, uri, settingsResourceName, null, null, null);
     }
 
-    public QuickfixjEngine(String uri, String settingsResourceName, MessageStoreFactory messageStoreFactoryOverride,
+    public QuickfixjEngine(CamelContext camelContext, String uri, String settingsResourceName,
+                           MessageStoreFactory messageStoreFactoryOverride,
                            LogFactory sessionLogFactoryOverride,
-                           MessageFactory messageFactoryOverride) throws ConfigError, FieldConvertError, IOException,
-                                                                  JMException {
-        this(uri, loadSettings(settingsResourceName), messageStoreFactoryOverride, sessionLogFactoryOverride,
+                           MessageFactory messageFactoryOverride) throws Exception {
+        this(camelContext, uri, loadSettings(camelContext, settingsResourceName), messageStoreFactoryOverride,
+             sessionLogFactoryOverride,
              messageFactoryOverride);
     }
 
-    /**
-     * @deprecated Better make use of the
-     *             {@link #QuickfixjEngine(String, SessionSettings, MessageStoreFactory, LogFactory, MessageFactory)}
-     *             constructor as the {@code forcedShutdown} paramater had/has no effect.
-     */
-    @Deprecated
-    public QuickfixjEngine(String uri, SessionSettings settings, boolean forcedShutdown,
-                           MessageStoreFactory messageStoreFactoryOverride, LogFactory sessionLogFactoryOverride,
-                           MessageFactory messageFactoryOverride) throws ConfigError, FieldConvertError, IOException,
-                                                                  JMException {
-        this(uri, settings, messageStoreFactoryOverride, sessionLogFactoryOverride, messageFactoryOverride);
-    }
-
-    public QuickfixjEngine(String uri, SessionSettings settings, MessageStoreFactory messageStoreFactoryOverride,
+    public QuickfixjEngine(CamelContext camelContext, String uri, SessionSettings settings,
+                           MessageStoreFactory messageStoreFactoryOverride,
                            LogFactory sessionLogFactoryOverride,
-                           MessageFactory messageFactoryOverride) throws ConfigError, FieldConvertError, IOException,
-                                                                  JMException {
-        this(uri, settings, messageStoreFactoryOverride, sessionLogFactoryOverride, messageFactoryOverride, false);
+                           MessageFactory messageFactoryOverride) throws Exception {
+        this(camelContext, uri, settings, messageStoreFactoryOverride, sessionLogFactoryOverride, messageFactoryOverride,
+             false);
     }
 
-    public QuickfixjEngine(String uri, SessionSettings settings, MessageStoreFactory messageStoreFactoryOverride,
+    public QuickfixjEngine(CamelContext camelContext, String uri, SessionSettings settings,
+                           MessageStoreFactory messageStoreFactoryOverride,
                            LogFactory sessionLogFactoryOverride,
                            MessageFactory messageFactoryOverride,
-                           boolean lazy) throws ConfigError, FieldConvertError, IOException, JMException {
+                           boolean lazy) throws Exception {
         addEventListener(messageCorrelator);
 
         this.uri = uri;
@@ -264,11 +226,8 @@ public class QuickfixjEngine extends ServiceSupport {
         initialized.set(true);
     }
 
-    static SessionSettings loadSettings(String settingsResourceName) throws ConfigError {
-        InputStream inputStream = ObjectHelper.loadResourceAsStream(settingsResourceName);
-        if (inputStream == null) {
-            throw new IllegalArgumentException("Could not load " + settingsResourceName);
-        }
+    protected static SessionSettings loadSettings(CamelContext camelContext, String settingsResourceName) throws Exception {
+        InputStream inputStream = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, settingsResourceName);
         return new SessionSettings(inputStream);
     }
 
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
index ef110cd..bdae0cb 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
@@ -22,7 +22,6 @@ import java.net.URLClassLoader;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.component.quickfixj.converter.QuickfixjConverters;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.support.DefaultExchange;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.AfterEach;
@@ -91,7 +90,7 @@ public class QuickfixjConvertersTest extends CamelTestSupport {
     @Test
     public void convertToExchange() {
         SessionID sessionID = new SessionID("FIX.4.0", "FOO", "BAR");
-        QuickfixjEndpoint endpoint = new QuickfixjEndpoint(null, "", new QuickfixjComponent(new DefaultCamelContext()));
+        QuickfixjEndpoint endpoint = new QuickfixjEndpoint(null, "", new QuickfixjComponent(context));
 
         Message message = new Message();
         message.getHeader().setString(MsgType.FIELD, MsgType.ORDER_SINGLE);
@@ -109,7 +108,7 @@ public class QuickfixjConvertersTest extends CamelTestSupport {
     @Test
     public void convertToExchangeWithNullMessage() {
         SessionID sessionID = new SessionID("FIX.4.0", "FOO", "BAR");
-        QuickfixjEndpoint endpoint = new QuickfixjEndpoint(null, "", new QuickfixjComponent(new DefaultCamelContext()));
+        QuickfixjEndpoint endpoint = new QuickfixjEndpoint(null, "", new QuickfixjComponent(context));
 
         Exchange exchange = QuickfixjConverters.toExchange(endpoint, sessionID, null, QuickfixjEventCategory.AppMessageSent);
 
@@ -226,7 +225,7 @@ public class QuickfixjConvertersTest extends CamelTestSupport {
 
         TestSupport.writeSettings(settings, settingsFile);
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(context, "quickfix:test", settingsFile.getName());
         quickfixjEngine.start();
     }
 }
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
index edd0084..460be6b 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.quickfixj;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.net.URL;
@@ -27,10 +28,11 @@ import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import javax.management.JMException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -38,7 +40,6 @@ import org.mockito.Mockito;
 import quickfix.Acceptor;
 import quickfix.ConfigError;
 import quickfix.DefaultMessageFactory;
-import quickfix.FieldConvertError;
 import quickfix.FieldNotFound;
 import quickfix.FileLogFactory;
 import quickfix.FileStoreFactory;
@@ -86,9 +87,12 @@ public class QuickfixjEngineTest {
     private SessionID sessionID;
     private File tempdir;
     private QuickfixjEngine quickfixjEngine;
+    private CamelContext camelContext;
 
     @BeforeEach
     public void setUp() throws Exception {
+        camelContext = new DefaultCamelContext();
+
         settingsFile = File.createTempFile("quickfixj_test_", ".cfg");
         tempdir = settingsFile.getParentFile();
         URL[] urls = new URL[] { tempdir.toURI().toURL() };
@@ -117,8 +121,8 @@ public class QuickfixjEngineTest {
 
     @Test
     public void missingSettingsResource() throws Exception {
-        assertThrows(IllegalArgumentException.class,
-                () -> new QuickfixjEngine("quickfix:test", "bogus.cfg"));
+        assertThrows(FileNotFoundException.class,
+                () -> new QuickfixjEngine(camelContext, "quickfix:test", "bogus.cfg"));
     }
 
     @Test
@@ -127,7 +131,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), instanceOf(SocketInitiator.class));
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -141,7 +145,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), instanceOf(ThreadedSocketInitiator.class));
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -155,7 +159,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), nullValue());
         assertThat(quickfixjEngine.getAcceptor(), instanceOf(SocketAcceptor.class));
@@ -170,7 +174,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), nullValue());
         assertThat(quickfixjEngine.getAcceptor(), instanceOf(ThreadedSocketAcceptor.class));
@@ -189,7 +193,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), notNullValue());
@@ -203,7 +207,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -226,7 +230,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -245,7 +249,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -273,7 +277,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -289,7 +293,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -305,7 +309,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -321,7 +325,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
 
         assertThat(quickfixjEngine.getInitiator(), notNullValue());
         assertThat(quickfixjEngine.getAcceptor(), nullValue());
@@ -341,9 +345,9 @@ public class QuickfixjEngineTest {
         doAmbiguityTest("Ambiguous log");
     }
 
-    private void doAmbiguityTest(String exceptionText) throws FieldConvertError, IOException, JMException {
+    private void doAmbiguityTest(String exceptionText) throws Exception {
         try {
-            quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+            quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
             fail("Expected exception, but none raised");
         } catch (ConfigError e) {
             assertTrue(e.getMessage().contains(exceptionText));
@@ -362,7 +366,8 @@ public class QuickfixjEngineTest {
         MessageFactory messageFactory = Mockito.mock(MessageFactory.class);
 
         quickfixjEngine
-                = new QuickfixjEngine("quickfix:test", settingsFile.getName(), messageStoreFactory, logFactory, messageFactory);
+                = new QuickfixjEngine(
+                        camelContext, "quickfix:test", settingsFile.getName(), messageStoreFactory, logFactory, messageFactory);
 
         assertThat(quickfixjEngine.getMessageStoreFactory(), is(messageStoreFactory));
         assertThat(quickfixjEngine.getLogFactory(), is(logFactory));
@@ -377,7 +382,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
         quickfixjEngine.start();
 
         MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
@@ -393,7 +398,7 @@ public class QuickfixjEngineTest {
 
         writeSettings();
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName());
+        quickfixjEngine = new QuickfixjEngine(camelContext, "quickfix:test", settingsFile.getName());
         quickfixjEngine.start();
 
         MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
@@ -406,7 +411,9 @@ public class QuickfixjEngineTest {
         SessionID acceptorSessionID = new SessionID(FixVersions.BEGINSTRING_FIX42, "MARKET", "TRADER");
         SessionID initiatorSessionID = new SessionID(FixVersions.BEGINSTRING_FIX42, "TRADER", "MARKET");
 
-        quickfixjEngine = new QuickfixjEngine("quickfix:test", "examples/inprocess.cfg");
+        quickfixjEngine = new QuickfixjEngine(
+                camelContext,
+                "quickfix:test", "examples/inprocess.cfg");
 
         doLogonEventsTest(acceptorSessionID, initiatorSessionID, quickfixjEngine);
 
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjLazyProducerTest.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjLazyProducerTest.java
deleted file mode 100644
index 66f3429..0000000
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjLazyProducerTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.quickfixj;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-import org.springframework.test.util.ReflectionTestUtils;
-import quickfix.FixVersions;
-import quickfix.Message;
-import quickfix.MessageUtils;
-import quickfix.SessionID;
-import quickfix.field.BeginString;
-import quickfix.field.SenderCompID;
-import quickfix.field.TargetCompID;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-@Disabled("Fails on CI server sometimes")
-public class QuickfixjLazyProducerTest {
-    private Exchange mockExchange;
-    private QuickfixjEndpoint endpoint;
-    private org.apache.camel.Message mockCamelMessage;
-    private QuickfixjProducer producer;
-    private SessionID sessionID;
-    private Message inboundFixMessage;
-    private QuickfixjEngine quickfixjEngine;
-
-    @BeforeEach
-    public void setUp() throws Exception {
-        mockExchange = Mockito.mock(Exchange.class);
-        mockCamelMessage = Mockito.mock(org.apache.camel.Message.class);
-        Mockito.when(mockExchange.getIn()).thenReturn(mockCamelMessage);
-        Mockito.when(mockExchange.getPattern()).thenReturn(ExchangePattern.InOnly);
-
-        quickfixjEngine = TestSupport.createEngine(true);
-        endpoint = Mockito.spy(new QuickfixjEndpoint(quickfixjEngine, "", new QuickfixjComponent()));
-
-        inboundFixMessage = new Message();
-        inboundFixMessage.getHeader().setString(BeginString.FIELD, FixVersions.BEGINSTRING_FIX44);
-        inboundFixMessage.getHeader().setString(SenderCompID.FIELD, "SENDER");
-        inboundFixMessage.getHeader().setString(TargetCompID.FIELD, "TARGET");
-        sessionID = MessageUtils.getSessionID(inboundFixMessage);
-
-        Mockito.when(mockCamelMessage.getBody(Message.class)).thenReturn(inboundFixMessage);
-
-        Mockito.when(endpoint.getSessionID()).thenReturn(sessionID);
-
-        producer = Mockito.spy(new QuickfixjProducer(endpoint));
-    }
-
-    @Test
-    public void processWithLazyEngine() throws Exception {
-        QuickfixjEngine engine = (QuickfixjEngine) ReflectionTestUtils.getField(endpoint, "engine");
-        assertThat(engine.isInitialized(), is(false));
-        assertThat(engine.isStarted(), is(false));
-        //        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
-        //        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
-        //        Mockito.doReturn(true).when(mockSession).send(Matchers.isA(Message.class));
-
-        producer.process(mockExchange);
-
-        assertThat(engine.isInitialized(), is(true));
-        assertThat(engine.isStarted(), is(true));
-        //
-        //        Mockito.verify(mockExchange, Mockito.never()).setException(Matchers.isA(IllegalStateException.class));
-        //        Mockito.verify(mockSession).send(inboundFixMessage);
-    }
-}
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 024440d..40cd207 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
@@ -16,20 +16,16 @@
  */
 package org.apache.camel.component.quickfixj;
 
-import java.io.IOException;
 import java.util.Timer;
 import java.util.TimerTask;
 
-import javax.management.JMException;
-
+import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 import org.mockito.stubbing.Answer;
-import quickfix.ConfigError;
-import quickfix.FieldConvertError;
 import quickfix.FixVersions;
 import quickfix.Message;
 import quickfix.MessageUtils;
@@ -51,16 +47,18 @@ public class QuickfixjProducerTest {
     private SessionID sessionID;
     private Message inboundFixMessage;
     private QuickfixjEngine quickfixjEngine;
+    private CamelContext context;
 
     @BeforeEach
-    public void setUp() throws ConfigError, FieldConvertError, IOException, JMException {
+    public void setUp() throws Exception {
         mockExchange = Mockito.mock(Exchange.class);
         mockEndpoint = Mockito.mock(QuickfixjEndpoint.class);
         mockCamelMessage = Mockito.mock(org.apache.camel.Message.class);
         Mockito.when(mockExchange.getIn()).thenReturn(mockCamelMessage);
         Mockito.when(mockExchange.getPattern()).thenReturn(ExchangePattern.InOnly);
+        context = Mockito.mock(CamelContext.class);
 
-        quickfixjEngine = TestSupport.createEngine();
+        quickfixjEngine = TestSupport.createEngine(context);
         Mockito.when(mockEndpoint.getEngine()).thenReturn(quickfixjEngine);
 
         inboundFixMessage = new Message();
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/TestSupport.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/TestSupport.java
index b19e314..bb4c7d2 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/TestSupport.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/TestSupport.java
@@ -21,14 +21,12 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Date;
 
-import javax.management.JMException;
-
+import org.apache.camel.CamelContext;
 import org.mockito.Mockito;
 import quickfix.Acceptor;
 import quickfix.Application;
 import quickfix.ConfigError;
 import quickfix.DefaultSessionFactory;
-import quickfix.FieldConvertError;
 import quickfix.LogFactory;
 import quickfix.MessageFactory;
 import quickfix.MessageStore;
@@ -93,11 +91,11 @@ public final class TestSupport {
         return factory.create(sessionID, settings);
     }
 
-    public static QuickfixjEngine createEngine() throws ConfigError, FieldConvertError, IOException, JMException {
-        return createEngine(false);
+    public static QuickfixjEngine createEngine(CamelContext camelContext) throws Exception {
+        return createEngine(camelContext, false);
     }
 
-    public static QuickfixjEngine createEngine(boolean lazy) throws ConfigError, FieldConvertError, IOException, JMException {
+    public static QuickfixjEngine createEngine(CamelContext camelContext, boolean lazy) throws Exception {
         SessionID sessionID = new SessionID("FIX.4.4:SENDER->TARGET");
 
         MessageStoreFactory mockMessageStoreFactory = Mockito.mock(MessageStoreFactory.class);
@@ -115,6 +113,7 @@ public final class TestSupport {
         settings.setBool(sessionID, Session.SETTING_USE_DATA_DICTIONARY, false);
 
         return new QuickfixjEngine(
+                camelContext,
                 "", settings,
                 mockMessageStoreFactory,
                 Mockito.mock(LogFactory.class),
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 4f826e3..be18290 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -11857,8 +11857,12 @@ public class StaticEndpointBuilders {
      * Syntax: <code>quickfix:configurationName</code>
      * 
      * Path parameter: configurationName (required)
-     * The configFile is the name of the QuickFIX/J configuration to use for the
-     * FIX engine (located as a resource found in your classpath).
+     * 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 the configuration file in the registry. bean will call a method on
+     * a bean to be used as the configuration. For bean you can specify the
+     * method name after dot, eg bean:myBean.myMethod
      * 
      * @param path configurationName
      */
@@ -11878,8 +11882,12 @@ public class StaticEndpointBuilders {
      * Syntax: <code>quickfix:configurationName</code>
      * 
      * Path parameter: configurationName (required)
-     * The configFile is the name of the QuickFIX/J configuration to use for the
-     * FIX engine (located as a resource found in your classpath).
+     * 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 the configuration file in the registry. bean will call a method on
+     * a bean to be used as the configuration. For bean you can specify the
+     * method name after dot, eg bean:myBean.myMethod
      * 
      * @param componentName to use a custom component name for the endpoint
      * instead of the default name
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 c1fecdf..9b7408b 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
@@ -606,8 +606,12 @@ public interface QuickfixjEndpointBuilderFactory {
          * Syntax: <code>quickfix:configurationName</code>
          * 
          * Path parameter: configurationName (required)
-         * The configFile is the name of the QuickFIX/J configuration to use for
-         * the FIX engine (located as a resource found in your classpath).
+         * 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 the configuration file in the registry. bean will
+         * call a method on a bean to be used as the configuration. For bean you
+         * can specify the method name after dot, eg bean:myBean.myMethod
          * 
          * @param path configurationName
          */
@@ -626,8 +630,12 @@ public interface QuickfixjEndpointBuilderFactory {
          * Syntax: <code>quickfix:configurationName</code>
          * 
          * Path parameter: configurationName (required)
-         * The configFile is the name of the QuickFIX/J configuration to use for
-         * the FIX engine (located as a resource found in your classpath).
+         * 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 the configuration file in the registry. bean will
+         * call a method on a bean to be used as the configuration. For bean you
+         * can specify the method name after dot, eg bean:myBean.myMethod
          * 
          * @param componentName to use a custom component name for the endpoint
          * instead of the default name