You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/07/20 11:31:48 UTC

[camel] branch master updated (ff769ec -> ea78cf3)

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 ff769ec  Regen Camel-Nats docs
     new 9441b89  CAMEL-12669 - Camel-Nats: add new client options available with client 2.x - maxPingsOut
     new ea78cf3  Camel-Nats: Fixed CS

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-nats/src/main/docs/nats-component.adoc   |  3 +-
 .../camel/component/nats/NatsConfiguration.java    | 37 +++++++++++++++-------
 2 files changed, 28 insertions(+), 12 deletions(-)


[camel] 01/02: CAMEL-12669 - Camel-Nats: add new client options available with client 2.x - maxPingsOut

Posted by ac...@apache.org.
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 9441b89d8963996447700e1553b956abc74421fb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 20 13:27:09 2018 +0200

    CAMEL-12669 - Camel-Nats: add new client options available with client 2.x - maxPingsOut
---
 components/camel-nats/src/main/docs/nats-component.adoc  |  3 ++-
 .../apache/camel/component/nats/NatsConfiguration.java   | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/components/camel-nats/src/main/docs/nats-component.adoc b/components/camel-nats/src/main/docs/nats-component.adoc
index 8f55119..337ee7a 100644
--- a/components/camel-nats/src/main/docs/nats-component.adoc
+++ b/components/camel-nats/src/main/docs/nats-component.adoc
@@ -66,7 +66,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (22 parameters):
+==== Query Parameters (23 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -75,6 +75,7 @@ with the following path and query parameters:
 | *connectionTimeout* (common) | Timeout for connection attempts. (in milliseconds) | 2000 | int
 | *flushConnection* (common) | Define if we want to flush connection or not | false | boolean
 | *flushTimeout* (common) | Set the flush timeout (in milliseconds) | 1000 | int
+| *maxPingsOut* (common) | maximum number of pings have not received a response allowed by the client | 2 | int
 | *maxReconnectAttempts* (common) | Max reconnection attempts | 60 | int
 | *noEcho* (common) | Turn off echo. If supported by the gnatsd version you are connecting to this flag will prevent the server from echoing messages back to the connection if it has subscriptions on the subject being published to. | false | boolean
 | *noRandomizeServers* (common) | Whether or not randomizing the order of servers for the connection attempts | false | boolean
diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
index 2443269..e5b6fab 100644
--- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
+++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
@@ -51,6 +51,8 @@ public class NatsConfiguration {
     private int pingInterval = 120000;
     @UriParam(label = "common", defaultValue = "2000")
     private int connectionTimeout = 2000;
+    @UriParam(label = "common", defaultValue = "2")
+    private int maxPingsOut = Options.DEFAULT_MAX_PINGS_OUT;
     @UriParam(label = "producer")
     private String replySubject;
     @UriParam
@@ -149,8 +151,21 @@ public class NatsConfiguration {
     public void setMaxReconnectAttempts(int maxReconnectAttempts) {
         this.maxReconnectAttempts = maxReconnectAttempts;
     }
+    
 
     /**
+     * maximum number of pings have not received a response allowed by the 
+     * client
+     */
+    public int getMaxPingsOut() {
+		return maxPingsOut;
+	}
+
+	public void setMaxPingsOut(int maxPingsOut) {
+		this.maxPingsOut = maxPingsOut;
+	}
+
+	/**
      * Ping interval to be aware if connection is still alive (in milliseconds)
      */
     public int getPingInterval() {
@@ -306,6 +321,7 @@ public class NatsConfiguration {
         }
         builder.pingInterval(Duration.ofMillis(getPingInterval()));
         builder.connectionTimeout(Duration.ofMillis(getConnectionTimeout()));
+        builder.maxPingsOut(getMaxPingsOut());
         if (getNoRandomizeServers()) {
             builder.noRandomize();
         }


[camel] 02/02: Camel-Nats: Fixed CS

Posted by ac...@apache.org.
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 ea78cf36c1f0a256849a671c42e636b926d13fb1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 20 13:30:48 2018 +0200

    Camel-Nats: Fixed CS
---
 .../camel/component/nats/NatsConfiguration.java    | 37 +++++++++++-----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
index e5b6fab..02b9dfd 100644
--- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
+++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
@@ -151,21 +151,20 @@ public class NatsConfiguration {
     public void setMaxReconnectAttempts(int maxReconnectAttempts) {
         this.maxReconnectAttempts = maxReconnectAttempts;
     }
-    
 
     /**
-     * maximum number of pings have not received a response allowed by the 
+     * maximum number of pings have not received a response allowed by the
      * client
      */
     public int getMaxPingsOut() {
-		return maxPingsOut;
-	}
+        return maxPingsOut;
+    }
 
-	public void setMaxPingsOut(int maxPingsOut) {
-		this.maxPingsOut = maxPingsOut;
-	}
+    public void setMaxPingsOut(int maxPingsOut) {
+        this.maxPingsOut = maxPingsOut;
+    }
 
-	/**
+    /**
      * Ping interval to be aware if connection is still alive (in milliseconds)
      */
     public int getPingInterval() {
@@ -175,19 +174,19 @@ public class NatsConfiguration {
     public void setPingInterval(int pingInterval) {
         this.pingInterval = pingInterval;
     }
-    
+
     /**
      * Timeout for connection attempts. (in milliseconds)
      */
     public int getConnectionTimeout() {
-		return connectionTimeout;
-	}
+        return connectionTimeout;
+    }
 
-	public void setConnectionTimeout(int connectionTimeout) {
-		this.connectionTimeout = connectionTimeout;
-	}
+    public void setConnectionTimeout(int connectionTimeout) {
+        this.connectionTimeout = connectionTimeout;
+    }
 
-	/**
+    /**
      * the subject to which subscribers should send response
      */
     public String getReplySubject() {
@@ -209,11 +208,11 @@ public class NatsConfiguration {
     public void setNoRandomizeServers(boolean noRandomizeServers) {
         this.noRandomizeServers = noRandomizeServers;
     }
-    
+
     /**
-     * Turn off echo. If supported by the gnatsd version you are connecting 
-     * to this flag will prevent the server from echoing messages back 
-     * to the connection if it has subscriptions on the subject being published to.
+     * Turn off echo. If supported by the gnatsd version you are connecting to
+     * this flag will prevent the server from echoing messages back to the
+     * connection if it has subscriptions on the subject being published to.
      */
     public boolean getNoEcho() {
         return noEcho;