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/02/20 05:10:22 UTC

[camel] branch master updated (5b04199 -> 1034a22)

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 5b04199  CAMEL-6950 camel-sjms: Lacks reconnection logic in case of exception (#3581)
     new 69f1264  CAMEL-6950: Regen
     new 1034a22  CAMEL-14594: Fixed NPE

The 2 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/component/sjms/SjmsEndpointConfigurer.java       |  4 ++++
 .../resources/org/apache/camel/component/sjms/sjms.json    |  2 ++
 components/camel-sjms/src/main/docs/sjms-component.adoc    |  4 +++-
 .../org/apache/camel/impl/engine/DefaultProducerCache.java | 14 +++++++++-----
 .../org/apache/camel/impl/engine/EmptyProducerCache.java   |  5 -----
 5 files changed, 18 insertions(+), 11 deletions(-)


[camel] 01/02: CAMEL-6950: Regen

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 69f126460f2a77ad1cb841d8f8b8a531fffb41a0
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 20 05:54:24 2020 +0100

    CAMEL-6950: Regen
---
 .../java/org/apache/camel/component/sjms/SjmsEndpointConfigurer.java  | 4 ++++
 .../src/generated/resources/org/apache/camel/component/sjms/sjms.json | 2 ++
 components/camel-sjms/src/main/docs/sjms-component.adoc               | 4 +++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/components/camel-sjms/src/generated/java/org/apache/camel/component/sjms/SjmsEndpointConfigurer.java b/components/camel-sjms/src/generated/java/org/apache/camel/component/sjms/SjmsEndpointConfigurer.java
index b0aaa01..8b53629 100644
--- a/components/camel-sjms/src/generated/java/org/apache/camel/component/sjms/SjmsEndpointConfigurer.java
+++ b/components/camel-sjms/src/generated/java/org/apache/camel/component/sjms/SjmsEndpointConfigurer.java
@@ -23,6 +23,10 @@ public class SjmsEndpointConfigurer extends PropertyConfigurerSupport implements
         case "consumerCount": target.setConsumerCount(property(camelContext, int.class, value)); return true;
         case "durablesubscriptionid":
         case "durableSubscriptionId": target.setDurableSubscriptionId(property(camelContext, java.lang.String.class, value)); return true;
+        case "reconnectbackoff":
+        case "reconnectBackOff": target.setReconnectBackOff(property(camelContext, org.apache.camel.util.backoff.BackOff.class, value)); return true;
+        case "reconnectonerror":
+        case "reconnectOnError": target.setReconnectOnError(property(camelContext, boolean.class, value)); return true;
         case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true;
         case "exceptionhandler":
         case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
diff --git a/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json b/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json
index 1fbbcf7..76fa614 100644
--- a/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json
+++ b/components/camel-sjms/src/generated/resources/org/apache/camel/component/sjms/sjms.json
@@ -44,6 +44,8 @@
     "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 [...]
     "consumerCount": { "kind": "parameter", "displayName": "Consumer Count", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "1", "description": "Sets the number of consumer listeners used for this endpoint." },
     "durableSubscriptionId": { "kind": "parameter", "displayName": "Durable Subscription Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Sets the durable subscription Id required for durable topics." },
+    "reconnectBackOff": { "kind": "parameter", "displayName": "Reconnect Back Off", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.util.backoff.BackOff", "deprecated": false, "secret": false, "description": "Backoff policy on consumer pool reconnection. Default value notice: Default backoff is infinite retries with 5 seconds delay" },
+    "reconnectOnError": { "kind": "parameter", "displayName": "Reconnect On Error", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Try to apply reconnection logic on consumer pool" },
     "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "description": "Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported)." },
     "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, "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 consumer will deal with [...]
     "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, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
diff --git a/components/camel-sjms/src/main/docs/sjms-component.adoc b/components/camel-sjms/src/main/docs/sjms-component.adoc
index ad309b6..a780e22 100644
--- a/components/camel-sjms/src/main/docs/sjms-component.adoc
+++ b/components/camel-sjms/src/main/docs/sjms-component.adoc
@@ -133,7 +133,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (36 parameters):
+=== Query Parameters (38 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -143,6 +143,8 @@ with the following path and query parameters:
 | *bridgeErrorHandler* (consumer) | 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 by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
 | *consumerCount* (consumer) | Sets the number of consumer listeners used for this endpoint. | 1 | int
 | *durableSubscriptionId* (consumer) | Sets the durable subscription Id required for durable topics. |  | String
+| *reconnectBackOff* (consumer) | Backoff policy on consumer pool reconnection. Default value notice: Default backoff is infinite retries with 5 seconds delay |  | BackOff
+| *reconnectOnError* (consumer) | Try to apply reconnection logic on consumer pool | false | boolean
 | *synchronous* (consumer) | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | true | boolean
 | *exceptionHandler* (consumer) | 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 consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. The value can be one of: InOnly, InOut, InOptionalOut |  | ExchangePattern


[camel] 02/02: CAMEL-14594: Fixed NPE

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 1034a22e5326702f090a5a890d2e557f3fa7d06c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 20 05:55:58 2020 +0100

    CAMEL-14594: Fixed NPE
---
 .../org/apache/camel/impl/engine/DefaultProducerCache.java | 14 +++++++++-----
 .../org/apache/camel/impl/engine/EmptyProducerCache.java   |  5 -----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultProducerCache.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultProducerCache.java
index a145d5b..1db1029 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultProducerCache.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultProducerCache.java
@@ -315,7 +315,7 @@ public class DefaultProducerCache extends ServiceSupport implements ProducerCach
                     }
 
                     // release back to the pool
-                    producers.release(endpoint, producer);
+                    releaseProducer(endpoint, producer);
                 } finally {
                     callback.done(doneSync);
                 }
@@ -375,7 +375,7 @@ public class DefaultProducerCache extends ServiceSupport implements ProducerCach
 
     @Override
     public int size() {
-        int size = producers.size();
+        int size = producers != null ? producers.size() : 0;
 
         LOG.trace("size = {}", size);
         return size;
@@ -389,8 +389,10 @@ public class DefaultProducerCache extends ServiceSupport implements ProducerCach
     @Override
     public synchronized void purge() {
         try {
-            producers.stop();
-            producers.start();
+            if (producers != null) {
+                producers.stop();
+                producers.start();
+            }
         } catch (Exception e) {
             LOG.debug("Error restarting producers", e);
         }
@@ -401,7 +403,9 @@ public class DefaultProducerCache extends ServiceSupport implements ProducerCach
 
     @Override
     public void cleanUp() {
-        producers.cleanUp();
+        if (producers != null) {
+            producers.cleanUp();
+        }
     }
 
     @Override
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/EmptyProducerCache.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/EmptyProducerCache.java
index 6b62070..6768850 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/EmptyProducerCache.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/EmptyProducerCache.java
@@ -64,11 +64,6 @@ public class EmptyProducerCache extends DefaultProducerCache {
     }
 
     @Override
-    public int size() {
-        return 0;
-    }
-
-    @Override
     public int getCapacity() {
         return 0;
     }