camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Component docs - fixed issue with hazelcast not including all of them
Date Sat, 02 Jan 2016 21:50:45 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 0db69ba10 -> 4e4e9e59d
  refs/heads/master 9d0dc7b2c -> 622ccbb69


Component docs - fixed issue with hazelcast not including all of them


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/622ccbb6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/622ccbb6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/622ccbb6

Branch: refs/heads/master
Commit: 622ccbb69839958c07374699fa0ce7108b289f73
Parents: 9d0dc7b
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Jan 2 22:49:08 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Jan 2 22:49:08 2016 +0100

----------------------------------------------------------------------
 .../component/hazelcast/HazelcastComponent.java |  6 ++--
 .../hazelcast/HazelcastDefaultEndpoint.java     |  3 ++
 .../seda/HazelcastSedaConfiguration.java        | 37 ++++++++++++++++----
 3 files changed, 38 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/622ccbb6/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
index a0a4308..b2f8716 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
@@ -119,11 +119,13 @@ public class HazelcastComponent extends UriEndpointComponent {
         }
 
         if (remaining.startsWith(HazelcastConstants.SEDA_PREFIX)) {
+            // remaining is anything (name it foo ;)
+            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.SEDA_PREFIX.length()),
'/');
             final HazelcastSedaConfiguration config = new HazelcastSedaConfiguration();
             setProperties(config, parameters);
-            config.setQueueName(remaining.substring(remaining.indexOf(":") + 1, remaining.length()));
-
+            config.setQueueName(remaining);
             endpoint = new HazelcastSedaEndpoint(hzInstance, uri, this, config);
+            endpoint.setCacheName(remaining);
             endpoint.setCommand(HazelcastCommand.seda);
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/622ccbb6/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java
index dec3f48..63b0ac7 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java
@@ -21,6 +21,7 @@ import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.component.hazelcast.seda.HazelcastSedaConfiguration;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
@@ -43,6 +44,8 @@ public abstract class HazelcastDefaultEndpoint extends DefaultEndpoint {
     protected String hazelcastInstanceName;
     @UriParam
     private int defaultOperation = -1;
+    @UriParam
+    private HazelcastSedaConfiguration hazelcastSedaConfiguration; // to include component
schema docs
 
     public HazelcastDefaultEndpoint(HazelcastInstance hazelcastInstance, String endpointUri,
Component component) {
         this(hazelcastInstance, endpointUri, component, null);

http://git-wip-us.apache.org/repos/asf/camel/blob/622ccbb6/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
index 3d9d1d8..99b801b 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConfiguration.java
@@ -16,15 +16,26 @@
  */
 package org.apache.camel.component.hazelcast.seda;
 
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+
 /**
  * Hazelcast SEDA Component configuration.
  */
+@UriParams
 public class HazelcastSedaConfiguration {
 
+    // is the cache name
+    private transient String queueName;
+
+    @UriParam(label = "seda", defaultValue = "1")
     private int concurrentConsumers = 1;
+    @UriParam(label = "seda", defaultValue = "1000")
     private int pollTimeout = 1000;
-    private String queueName;
+    @UriParam(label = "seda")
     private boolean transferExchange;
+    @UriParam(label = "seda")
     private boolean transacted;
 
     public HazelcastSedaConfiguration() {
@@ -34,19 +45,22 @@ public class HazelcastSedaConfiguration {
         return concurrentConsumers;
     }
 
-    public void setConcurrentConsumers(final int concurrentConsumers) {
-        this.concurrentConsumers = concurrentConsumers;
-    }
-
     public String getQueueName() {
         return queueName;
     }
 
-    public void setQueueName(final String queueName) {
+    public void setQueueName(String queueName) {
         this.queueName = queueName;
     }
 
     /**
+     * To use concurrent consumers polling from the SEDA queue.
+     */
+    public void setConcurrentConsumers(final int concurrentConsumers) {
+        this.concurrentConsumers = concurrentConsumers;
+    }
+
+    /**
      * @deprecated use pollTimeout instead
      */
     @Deprecated
@@ -66,6 +80,10 @@ public class HazelcastSedaConfiguration {
         return pollTimeout;
     }
 
+    /**
+     * The timeout used when consuming from the SEDA queue. When a timeout occurs, the consumer
can check whether
+     * it is allowed to continue running. Setting a lower value allows the consumer to react
more quickly upon shutdown.
+     */
     public void setPollTimeout(int pollTimeout) {
         this.pollTimeout = pollTimeout;
     }
@@ -74,6 +92,9 @@ public class HazelcastSedaConfiguration {
         return transferExchange;
     }
 
+    /**
+     * If set to true the whole Exchange will be transfered. If header or body contains not
serializable objects, they will be skipped.
+     */
     public void setTransferExchange(boolean transferExchange) {
         this.transferExchange = transferExchange;
     }
@@ -82,6 +103,10 @@ public class HazelcastSedaConfiguration {
         return transacted;
     }
 
+    /**
+     * If set to true then the consumer runs in transaction mode, where the messages in the
seda queue will only be removed
+     * if the transaction commits, which happens when the processing is complete.
+     */
     public void setTransacted(boolean transacted) {
         this.transacted = transacted;
     }


Mime
View raw message