[camel] branch master updated (fe919d4 -> dd39d79)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (fe919d4 -> dd39d79)

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

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


    from fe919d4  Upgrade Hazelcast to version 3.10.5
     new a481a51  Use the latest hazelcast-kubernetes-bootstrapper in the hazelcast-kubernetes example (3.10.5)
     new 7c8df47  CAMEL-12807 Avoid to use endpoint attribute when MqttConnectOptions is declared once
     new fd463ab  CAMEL-12807 - Fix documentation
     new dd39d79  CAMEL-12807 - Fixed CS

The 4 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-paho/src/main/docs/paho-component.adoc   |  3 +-
 .../apache/camel/component/paho/PahoEndpoint.java  | 32 ++++++++++++++++------
 .../camel/component/paho/PahoComponentTest.java    |  2 +-
 .../component/paho/PahoOverrideTopicTest.java      |  2 +-
 .../resources/fabric8/hazelcast-deployment.yaml    |  2 +-
 5 files changed, 29 insertions(+), 12 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/04: Use the latest hazelcast-kubernetes-bootstrapper in the hazelcast-kubernetes example (3.10.5)

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

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

commit a481a517055b6bb6cfce002c5fe79d413334016a
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Fri Sep 14 15:31:47 2018 +0200

    Use the latest hazelcast-kubernetes-bootstrapper in the hazelcast-kubernetes example (3.10.5)
---
 .../src/main/resources/fabric8/hazelcast-deployment.yaml                | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/camel-example-hazelcast-kubernetes/src/main/resources/fabric8/hazelcast-deployment.yaml b/examples/camel-example-hazelcast-kubernetes/src/main/resources/fabric8/hazelcast-deployment.yaml
index e9750d8..63a05e4 100644
--- a/examples/camel-example-hazelcast-kubernetes/src/main/resources/fabric8/hazelcast-deployment.yaml
+++ b/examples/camel-example-hazelcast-kubernetes/src/main/resources/fabric8/hazelcast-deployment.yaml
@@ -12,7 +12,7 @@ spec:
     spec:
       containers:
       - name: hazelcast
-        image: quay.io/pires/hazelcast-kubernetes:3.10.4
+        image: quay.io/pires/hazelcast-kubernetes:3.10.5
         imagePullPolicy: Always
         env:
         - name: "DNS_DOMAIN"

Reply | Threaded
Open this post in threaded view
|

[camel] 02/04: CAMEL-12807 Avoid to use endpoint attribute when MqttConnectOptions is declared once

acosentino
In reply to this post by acosentino
This is an automated email from the ASF dual-hosted git repository.

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

commit 7c8df4751eaa45716b52cfa5e9da1bf47f1f2221
Author: Fabrizio Spataro <[hidden email]>
AuthorDate: Thu Sep 13 15:37:45 2018 +0200

    CAMEL-12807 Avoid to use endpoint attribute when MqttConnectOptions is declared once
---
 .../camel-paho/src/main/docs/paho-component.adoc   |  1 +
 .../apache/camel/component/paho/PahoEndpoint.java  | 28 +++++++++++++++-------
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/components/camel-paho/src/main/docs/paho-component.adoc b/components/camel-paho/src/main/docs/paho-component.adoc
index 723f883..0514235 100644
--- a/components/camel-paho/src/main/docs/paho-component.adoc
+++ b/components/camel-paho/src/main/docs/paho-component.adoc
@@ -95,6 +95,7 @@ with the following path and query parameters:
 | *brokerUrl* (common) | The URL of the MQTT broker. | tcp://localhost:1883 | String
 | *clientId* (common) | MQTT client identifier. |  | String
 | *connectOptions* (common) | Client connection options |  | MqttConnectOptions
+| *resolveMqttConnectOptions* (common) | Auto Resolve Client connection options | true | boolean
 | *filePersistenceDirectory* (common) | Base directory used by the file persistence provider. |  | String
 | *password* (common) | Password to be used for authentication against the MQTT broker |  | String
 | *persistence* (common) | Client persistence to be used - memory or file. | MEMORY | PahoPersistence
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index 8d858d5..6d58751 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -68,7 +68,8 @@ public class PahoEndpoint extends DefaultEndpoint {
     private String userName;
     @UriParam @Metadata(secret = true)
     private String password;
-    
+    @UriParam(defaultValue = "true")
+    private boolean resolveMqttConnectOptions = true;
 
     // Collaboration members
     @UriParam
@@ -135,13 +136,16 @@ public class PahoEndpoint extends DefaultEndpoint {
         if (connectOptions != null) {
             return connectOptions;
         }
-        Set<MqttConnectOptions> connectOptions = getCamelContext().getRegistry().findByType(MqttConnectOptions.class);
-        if (connectOptions.size() == 1) {
-            LOG.info("Single MqttConnectOptions instance found in the registry. It will be used by the endpoint.");
-            return connectOptions.iterator().next();
-        } else if (connectOptions.size() > 1) {
-            LOG.warn("Found {} instances of the MqttConnectOptions in the registry. None of these will be used by the endpoint. "
-                     + "Please use 'connectOptions' endpoint option to select one.", connectOptions.size());
+        
+        if(resolveMqttConnectOptions) {
+            Set<MqttConnectOptions> connectOptions = getCamelContext().getRegistry().findByType(MqttConnectOptions.class);
+            if (connectOptions.size() == 1) {
+                LOG.info("Single MqttConnectOptions instance found in the registry. It will be used by the endpoint.");
+                return connectOptions.iterator().next();
+            } else if (connectOptions.size() > 1) {
+                LOG.warn("Found {} instances of the MqttConnectOptions in the registry. None of these will be used by the endpoint. "
+                         + "Please use 'connectOptions' endpoint option to select one.", connectOptions.size());
+            }
         }
         
         MqttConnectOptions options = new MqttConnectOptions();
@@ -306,4 +310,12 @@ public class PahoEndpoint extends DefaultEndpoint {
         this.password = password;
     }
 
+    public synchronized boolean isResolveMqttConnectOptions() {
+        return resolveMqttConnectOptions;
+    }
+
+    public synchronized void setResolveMqttConnectOptions(boolean resolveMqttConnectOptions) {
+        this.resolveMqttConnectOptions = resolveMqttConnectOptions;
+    }
+
 }

Reply | Threaded
Open this post in threaded view
|

[camel] 03/04: CAMEL-12807 - Fix documentation

acosentino
In reply to this post by acosentino
This is an automated email from the ASF dual-hosted git repository.

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

commit fd463ab7f6ce18a6bea516393d6d01037de07b64
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Fri Sep 14 15:36:35 2018 +0200

    CAMEL-12807 - Fix documentation
---
 components/camel-paho/src/main/docs/paho-component.adoc               | 4 ++--
 .../src/main/java/org/apache/camel/component/paho/PahoEndpoint.java   | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/components/camel-paho/src/main/docs/paho-component.adoc b/components/camel-paho/src/main/docs/paho-component.adoc
index 0514235..c70b773 100644
--- a/components/camel-paho/src/main/docs/paho-component.adoc
+++ b/components/camel-paho/src/main/docs/paho-component.adoc
@@ -85,7 +85,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (14 parameters):
+==== Query Parameters (15 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -95,11 +95,11 @@ with the following path and query parameters:
 | *brokerUrl* (common) | The URL of the MQTT broker. | tcp://localhost:1883 | String
 | *clientId* (common) | MQTT client identifier. |  | String
 | *connectOptions* (common) | Client connection options |  | MqttConnectOptions
-| *resolveMqttConnectOptions* (common) | Auto Resolve Client connection options | true | boolean
 | *filePersistenceDirectory* (common) | Base directory used by the file persistence provider. |  | String
 | *password* (common) | Password to be used for authentication against the MQTT broker |  | String
 | *persistence* (common) | Client persistence to be used - memory or file. | MEMORY | PahoPersistence
 | *qos* (common) | Client quality of service level (0-2). | 2 | int
+| *resolveMqttConnectOptions* (common) | Define if you don't want to resolve the MQTT Connect Options from registry | true | boolean
 | *retained* (common) | Retain option | false | boolean
 | *userName* (common) | Username to be used for authentication against the MQTT broker |  | String
 | *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
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index 6d58751..da08e77 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -314,6 +314,10 @@ public class PahoEndpoint extends DefaultEndpoint {
         return resolveMqttConnectOptions;
     }
 
+    /**
+     * Define if you don't want to resolve the MQTT Connect Options from registry
+     * @param resolveMqttConnectOptions
+     */
     public synchronized void setResolveMqttConnectOptions(boolean resolveMqttConnectOptions) {
         this.resolveMqttConnectOptions = resolveMqttConnectOptions;
     }

Reply | Threaded
Open this post in threaded view
|

[camel] 04/04: CAMEL-12807 - Fixed CS

acosentino
In reply to this post by acosentino
This is an automated email from the ASF dual-hosted git repository.

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

commit dd39d79cadd8eba9f2a8273bb234980dea76e19c
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Fri Sep 14 15:38:56 2018 +0200

    CAMEL-12807 - Fixed CS
---
 .../src/main/java/org/apache/camel/component/paho/PahoEndpoint.java     | 2 +-
 .../test/java/org/apache/camel/component/paho/PahoComponentTest.java    | 2 +-
 .../java/org/apache/camel/component/paho/PahoOverrideTopicTest.java     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
index da08e77..86b6cc0 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoEndpoint.java
@@ -137,7 +137,7 @@ public class PahoEndpoint extends DefaultEndpoint {
             return connectOptions;
         }
         
-        if(resolveMqttConnectOptions) {
+        if (resolveMqttConnectOptions) {
             Set<MqttConnectOptions> connectOptions = getCamelContext().getRegistry().findByType(MqttConnectOptions.class);
             if (connectOptions.size() == 1) {
                 LOG.info("Single MqttConnectOptions instance found in the registry. It will be used by the endpoint.");
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index e045482..4526b30 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 package org.apache.camel.component.paho;
-import org.junit.After;
 
 import java.io.UnsupportedEncodingException;
 
@@ -29,6 +28,7 @@ import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
 import org.eclipse.paho.client.mqttv3.MqttMessage;
+import org.junit.After;
 import org.junit.Test;
 
 public class PahoComponentTest extends CamelTestSupport {
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
index 291b1de..2815698 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 package org.apache.camel.component.paho;
-import org.junit.After;
 
 import org.apache.activemq.broker.BrokerService;
 import org.apache.camel.builder.RouteBuilder;
@@ -23,6 +22,7 @@ import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
+import org.junit.After;
 import org.junit.Test;
 
 public class PahoOverrideTopicTest extends CamelTestSupport {