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/12 23:02:16 UTC

[camel] branch main updated (76b1a79 -> b4b3921)

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

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


    from 76b1a79  (chores) camel-zookeeper: fixed typo (#6435)
     new e82cc97  CAMEL-17190: camel-quickfix - The consumer should add/remove itself from active consumers on the endpoint so the engine can emit events to only running consumers.
     new d3ce7fe  Fixed example
     new b4b3921  Upgrade quickfixj 2.3.1

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 camel-dependencies/pom.xml                              |  2 +-
 .../camel/component/quickfixj/QuickfixjConsumer.java    | 17 +++++++++++++++--
 .../camel/component/quickfixj/QuickfixjEndpoint.java    | 12 ++++++++----
 .../quickfixj/examples/RequestReplyExample.java         |  2 +-
 parent/pom.xml                                          |  2 +-
 5 files changed, 26 insertions(+), 9 deletions(-)

[camel] 02/03: Fixed example

Posted by da...@apache.org.
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 d3ce7fe2a43c311d286bf60b5e40a23db3a9df04
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Nov 12 23:51:10 2021 +0100

    Fixed example
---
 .../apache/camel/component/quickfixj/examples/RequestReplyExample.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
index 3fec649..ce14244 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
@@ -80,7 +80,7 @@ public class RequestReplyExample {
                 // order status being delivered using the json printer.
                 from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER&exchangePattern=InOut")
                         .filter(header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.ORDER_STATUS_REQUEST))
-                        .to("log://OrderStatusRequestLog?showAll=true&showOut=true&multiline=true")
+                        .to("log://OrderStatusRequestLog?showAll=true&multiline=true")
                         .bean(new MarketOrderStatusService())
                         .bean(new QuickfixjMessageJsonPrinter());
 

[camel] 03/03: Upgrade quickfixj 2.3.1

Posted by da...@apache.org.
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 b4b3921a511b80dc018d51b21b887f09f0403754
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Nov 12 23:51:21 2021 +0100

    Upgrade quickfixj 2.3.1
---
 camel-dependencies/pom.xml | 2 +-
 parent/pom.xml             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index acbde60..1f518ee 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -469,7 +469,7 @@
     <qpid-jms-client-version>0.59.0</qpid-jms-client-version>
     <qpid-proton-j-version>0.33.8</qpid-proton-j-version>
     <quartz-version>2.3.2</quartz-version>
-    <quickfixj-version>2.3.0</quickfixj-version>
+    <quickfixj-version>2.3.1</quickfixj-version>
     <rabbitmq-amqp-client-version>5.12.0</rabbitmq-amqp-client-version>
     <rdf4j-model-version>3.7.2</rdf4j-model-version>
     <rdf4j-rio-version>3.7.2</rdf4j-rio-version>
diff --git a/parent/pom.xml b/parent/pom.xml
index 1be8c9c..522899b 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -457,7 +457,7 @@
         <qpid-proton-j-version>0.33.8</qpid-proton-j-version>
         <qpid-jms-client-version>0.59.0</qpid-jms-client-version>
         <quartz-version>2.3.2</quartz-version>
-        <quickfixj-version>2.3.0</quickfixj-version>
+        <quickfixj-version>2.3.1</quickfixj-version>
         <rabbitmq-amqp-client-version>5.12.0</rabbitmq-amqp-client-version>
         <rdf4j-rio-version>3.7.2</rdf4j-rio-version>
         <rdf4j-model-version>3.7.2</rdf4j-model-version>

[camel] 01/03: CAMEL-17190: camel-quickfix - The consumer should add/remove itself from active consumers on the endpoint so the engine can emit events to only running consumers.

Posted by da...@apache.org.
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 e82cc97b3e805519ac9fd9e3d73f3228bf8d9f40
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Nov 12 23:44:05 2021 +0100

    CAMEL-17190: camel-quickfix - The consumer should add/remove itself from active consumers on the endpoint so the engine can emit events to only running consumers.
---
 .../camel/component/quickfixj/QuickfixjConsumer.java    | 17 +++++++++++++++--
 .../camel/component/quickfixj/QuickfixjEndpoint.java    | 12 ++++++++----
 2 files changed, 23 insertions(+), 6 deletions(-)

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 0a6d744..d97e35d 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
@@ -36,15 +36,28 @@ public class QuickfixjConsumer extends DefaultConsumer {
     }
 
     @Override
+    public QuickfixjEndpoint getEndpoint() {
+        return (QuickfixjEndpoint) super.getEndpoint();
+    }
+
+    @Override
     protected void doStart() throws Exception {
-        ((QuickfixjEndpoint) getEndpoint()).ensureInitialized();
+        getEndpoint().addConsumer(this);
+        getEndpoint().ensureInitialized();
         super.doStart();
     }
 
-    public void onExchange(Exchange exchange) throws Exception {
+    @Override
+    protected void doStop() throws Exception {
+        getEndpoint().removeConsumer(this);
+        super.doStop();
+    }
+
+    public void onExchange(Exchange exchange) {
         if (isStarted()) {
             try {
                 getProcessor().process(exchange);
+
                 if (exchange.getPattern().isOutCapable() && exchange.hasOut()) {
                     sendOutMessage(exchange);
                 }
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 b83f0bc..41eb763 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,7 +33,6 @@ 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;
@@ -116,7 +115,6 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
                 getExchangePattern());
         QuickfixjConsumer consumer = new QuickfixjConsumer(this, processor);
         configureConsumer(consumer);
-        consumers.add(consumer);
         return consumer;
     }
 
@@ -129,12 +127,18 @@ public class QuickfixjEndpoint extends DefaultEndpoint implements QuickfixjEvent
         return new QuickfixjProducer(this);
     }
 
+    protected void addConsumer(QuickfixjConsumer consumer) {
+        consumers.add(consumer);
+    }
+
+    protected void removeConsumer(QuickfixjConsumer consumer) {
+        consumers.remove(consumer);
+    }
+
     @Override
     public void onEvent(QuickfixjEventCategory eventCategory, SessionID sessionID, Message message) throws Exception {
         if (this.sessionID == null || isMatching(sessionID)) {
             for (QuickfixjConsumer consumer : consumers) {
-                // ensure consumer is started
-                ServiceHelper.startService(consumer);
                 Exchange exchange
                         = QuickfixjConverters.toExchange(consumer, sessionID, message, eventCategory, getExchangePattern());
                 try {