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/19 12:39:48 UTC

[camel] branch master updated (f01eb26 -> 3c4d0c4)

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 f01eb26  camel-mongodb3 - short note using
     new ab9b7f2  CAMEL-12669 - Camel-Nats: add new client options available with client 2.x - noEcho option
     new 3c4d0c4  CAMEL-12669 - 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 ++-
 .../apache/camel/component/nats/NatsConfiguration.java | 18 ++++++++++++++++++
 .../org/apache/camel/component/nats/NatsEndpoint.java  | 10 +++++-----
 .../camel/component/nats/NatsConsumerLoadTest.java     |  2 +-
 4 files changed, 26 insertions(+), 7 deletions(-)


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

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 ab9b7f29ec1b69300db0f697aac89f59ab59888d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jul 19 14:37:23 2018 +0200

    CAMEL-12669 - Camel-Nats: add new client options available with client 2.x - noEcho option
---
 .../camel-nats/src/main/docs/nats-component.adoc       |  3 ++-
 .../apache/camel/component/nats/NatsConfiguration.java | 18 ++++++++++++++++++
 .../camel/component/nats/NatsConsumerLoadTest.java     |  2 +-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/components/camel-nats/src/main/docs/nats-component.adoc b/components/camel-nats/src/main/docs/nats-component.adoc
index d356918..74516c7 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 (20 parameters):
+==== Query Parameters (21 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -75,6 +75,7 @@ with the following path and query parameters:
 | *flushConnection* (common) | Define if we want to flush connection or not | false | boolean
 | *flushTimeout* (common) | Set the flush timeout | 1000 | int
 | *maxReconnectAttempts* (common) | Max reconnection attempts | 3 | 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
 | *pedantic* (common) | Whether or not running in pedantic mode (this affects performace) | false | boolean
 | *pingInterval* (common) | Ping interval to be aware if connection is still alive (in milliseconds) | 4000 | int
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 4f1eb53..4f9bd14 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
@@ -53,6 +53,8 @@ public class NatsConfiguration {
     private String replySubject;
     @UriParam
     private boolean noRandomizeServers;
+    @UriParam
+    private boolean noEcho;
     @UriParam(label = "consumer")
     private String queueName;
     @UriParam(label = "consumer")
@@ -179,6 +181,19 @@ 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.
+     */
+    public boolean getNoEcho() {
+        return noEcho;
+    }
+
+    public void setNoEcho(boolean noEcho) {
+        this.noEcho = noEcho;
+    }
 
     /**
      * The Queue name if we are using nats for a queue configuration
@@ -280,6 +295,9 @@ public class NatsConfiguration {
         if (getNoRandomizeServers()) {
             builder.noRandomize();
         }
+        if (getNoEcho()) {
+            builder.noEcho();
+        }
         return builder;
     }
 
diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerLoadTest.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerLoadTest.java
index 830e031..b2f6d5a 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerLoadTest.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerLoadTest.java
@@ -30,7 +30,7 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Ignore;
 import org.junit.Test;
 
-@Ignore("Require a running Nats server")
+//@Ignore("Require a running Nats server")
 public class NatsConsumerLoadTest extends CamelTestSupport {
     
     @EndpointInject(uri = "mock:result")


[camel] 02/02: CAMEL-12669 - 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 3c4d0c45827cad78f9cc60d7047a0442c87608d8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jul 19 14:39:05 2018 +0200

    CAMEL-12669 - Fixed CS
---
 .../java/org/apache/camel/component/nats/NatsEndpoint.java     | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
index b89ac69..93ec697 100644
--- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
+++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
@@ -22,6 +22,11 @@ import java.util.concurrent.ExecutorService;
 
 import javax.net.ssl.SSLContext;
 
+import io.nats.client.Connection;
+import io.nats.client.Nats;
+import io.nats.client.Options;
+import io.nats.client.Options.Builder;
+
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -29,11 +34,6 @@ import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 
-import io.nats.client.Connection;
-import io.nats.client.Nats;
-import io.nats.client.Options;
-import io.nats.client.Options.Builder;
-
 /**
  * The nats component allows you produce and consume messages from <a href="http://nats.io/">NATS</a>.
  */