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/05/04 05:38:58 UTC

[camel] branch master updated (ec2b5b1 -> 390d4fb)

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

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


    from ec2b5b1  CAMEL-14998: component docs - Mark newly added artifacts as preview support level by default
     new e5f3a83  camel-core - Aggregate EIP should return true if processed synchronously.
     new 81ec7ba  Upgrade shiro
     new 390d4fb  Upgrade roaster

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:
 .../processor/aggregate/AggregateProcessor.java    | 42 +++++++++++-----------
 parent/pom.xml                                     |  4 +--
 2 files changed, 23 insertions(+), 23 deletions(-)


[camel] 01/03: camel-core - Aggregate EIP should return true if processed synchronously.

Posted by da...@apache.org.
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

commit e5f3a83c64d8cf32b74334d85a65d5eb82407636
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun May 3 22:45:52 2020 +0200

    camel-core - Aggregate EIP should return true if processed synchronously.
---
 .../processor/aggregate/AggregateProcessor.java    | 42 +++++++++++-----------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java b/core/camel-base/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index be34e22..638b9f5 100644
--- a/core/camel-base/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ b/core/camel-base/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -317,16 +317,15 @@ public class AggregateProcessor extends AsyncProcessorSupport implements Navigat
     @Override
     public boolean process(Exchange exchange, AsyncCallback callback) {
         try {
-            doProcess(exchange, callback);
+            return doProcess(exchange, callback);
         } catch (Throwable e) {
             exchange.setException(e);
-            callback.done(false);
+            callback.done(true);
+            return true;
         }
-        return false;
     }
 
-    protected void doProcess(Exchange exchange, AsyncCallback callback) throws Exception {
-
+    protected boolean doProcess(Exchange exchange, AsyncCallback callback) throws Exception {
         if (getStatistics().isStatisticsEnabled()) {
             totalIn.incrementAndGet();
         }
@@ -335,8 +334,8 @@ public class AggregateProcessor extends AsyncProcessorSupport implements Navigat
         if (isCompleteAllGroups(exchange)) {
             removeFlagCompleteAllGroups(exchange);
             forceCompletionOfAllGroups();
-            callback.done(false);
-            return;
+            callback.done(true);
+            return true;
         }
 
         // compute correlation expression
@@ -348,30 +347,29 @@ public class AggregateProcessor extends AsyncProcessorSupport implements Navigat
             } else {
                 exchange.setException(new CamelExchangeException("Invalid correlation key", exchange));
             }
-            callback.done(false);
-            return;
+            callback.done(true);
+            return true;
         }
 
         // is the correlation key closed?
         if (closedCorrelationKeys != null && closedCorrelationKeys.containsKey(key)) {
             exchange.setException(new ClosedCorrelationKeyException(key, exchange));
-            callback.done(false);
-            return;
+            callback.done(true);
+            return true;
         }
 
         if (optimisticLocking) {
-            doInOptimisticLock(exchange, key, callback, 0);
+            return doInOptimisticLock(exchange, key, callback, 0, true);
         } else {
-            doProcess(exchange, key, callback);
+            return doProcess(exchange, key, callback, true);
         }
     }
 
-    protected void doInOptimisticLock(Exchange exchange, String key, AsyncCallback callback, int attempt) {
+    protected boolean doInOptimisticLock(Exchange exchange, String key, AsyncCallback callback, int attempt, boolean sync) {
         while (true) {
             attempt++;
             try {
-                doProcess(exchange, key, callback);
-                return;
+                return doProcess(exchange, key, callback, sync);
             } catch (OptimisticLockingAggregationRepository.OptimisticLockingException e) {
                 LOG.trace("On attempt {} OptimisticLockingAggregationRepository: {} threw OptimisticLockingException while trying to aggregate exchange: {}",
                         attempt, aggregationRepository, exchange, e);
@@ -379,19 +377,20 @@ public class AggregateProcessor extends AsyncProcessorSupport implements Navigat
                     long delay = optimisticLockRetryPolicy.getDelay(attempt);
                     if (delay > 0) {
                         int nextAttempt = attempt;
-                        getOptimisticLockingExecutorService().schedule(() -> doInOptimisticLock(exchange, key, callback, nextAttempt), delay, TimeUnit.MILLISECONDS);
+                        getOptimisticLockingExecutorService().schedule(() -> doInOptimisticLock(exchange, key, callback, nextAttempt, false), delay, TimeUnit.MILLISECONDS);
+                        return false;
                     }
                 } else {
                     exchange.setException(new CamelExchangeException("Exhausted optimistic locking retry attempts, tried " + attempt + " times", exchange,
                             new OptimisticLockingAggregationRepository.OptimisticLockingException()));
-                    callback.done(false);
-                    return;
+                    callback.done(sync);
+                    return sync;
                 }
             }
         }
     }
 
-    protected void doProcess(Exchange exchange, String key, AsyncCallback callback) {
+    protected boolean doProcess(Exchange exchange, String key, AsyncCallback callback, boolean sync) {
         // copy exchange, and do not share the unit of work
         // the aggregated output runs in another unit of work
         Exchange copy = ExchangeHelper.createCorrelatedCopy(exchange, false);
@@ -423,7 +422,8 @@ public class AggregateProcessor extends AsyncProcessorSupport implements Navigat
             forceCompletionOfAllGroups();
         }
 
-        callback.done(false);
+        callback.done(sync);
+        return sync;
     }
 
     private Object removeFlagCompleteCurrentGroup(Exchange exchange) {


[camel] 02/03: Upgrade shiro

Posted by da...@apache.org.
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

commit 81ec7bab205b4f57bc86570e84e71b323bb769ab
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon May 4 07:26:39 2020 +0200

    Upgrade shiro
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index aa0ddf4..c32b076 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -484,7 +484,7 @@
         <scribe-version>1.3.7</scribe-version>
         <servicemix-specs-version>2.9.0</servicemix-specs-version>
         <servlet-version-range>[3,4)</servlet-version-range>
-        <shiro-version>1.5.2</shiro-version>
+        <shiro-version>1.5.3</shiro-version>
         <shrinkwrap-descriptors-version>2.0.0</shrinkwrap-descriptors-version>
         <shrinkwrap-resolver-version>3.1.3</shrinkwrap-resolver-version>
         <shrinkwrap-version>1.2.6</shrinkwrap-version>


[camel] 03/03: Upgrade roaster

Posted by da...@apache.org.
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

commit 390d4fbffcdd2442e3860311a3c8973220a828bb
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon May 4 07:28:40 2020 +0200

    Upgrade roaster
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index c32b076..f37b87a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -474,7 +474,7 @@
         <rhino-version>1.7.7.1</rhino-version>
         <rhino-js-version>1.7R2</rhino-js-version>
         <ribbon-version>2.3.0</ribbon-version>
-        <roaster-version>2.21.1.Final</roaster-version>
+        <roaster-version>2.21.2.Final</roaster-version>
         <robotframework-version>3.1.1</robotframework-version>
         <rome-version>1.12.2</rome-version>
         <rxjava-version>1.3.8</rxjava-version>