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 2019/08/14 13:20:33 UTC

[camel] 02/04: Increase configuration options for Pulsar

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 ddbf1ea31c535b529b9e5045a76f577e0d5d1b33
Author: Sherman Richard <sh...@thehutgroup.com>
AuthorDate: Tue Aug 13 13:57:09 2019 +0100

    Increase configuration options for Pulsar
---
 .../src/main/docs/pulsar-component.adoc            |  11 +-
 .../endpoint/dsl/PulsarEndpointBuilderFactory.java | 260 +++++++++++++++++++++
 2 files changed, 270 insertions(+), 1 deletion(-)

diff --git a/components/camel-pulsar/src/main/docs/pulsar-component.adoc b/components/camel-pulsar/src/main/docs/pulsar-component.adoc
index 89141bb..7b929f9 100644
--- a/components/camel-pulsar/src/main/docs/pulsar-component.adoc
+++ b/components/camel-pulsar/src/main/docs/pulsar-component.adoc
@@ -69,7 +69,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (16 parameters):
+=== Query Parameters (25 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -87,8 +87,17 @@ with the following path and query parameters:
 | *subscriptionType* (consumer) | Type of the subscription EXCLUSIVESHAREDFAILOVER, defaults to EXCLUSIVE | EXCLUSIVE | SubscriptionType
 | *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. |  | ExchangePattern
+| *batchingEnabled* (producer) | Control whether automatic batching of messages is enabled for the producer. Default is true. | true | boolean
+| *batchingMaxMessages* (producer) | Set the maximum number of messages permitted in a batch. Default 1,000. | 1000 | int
+| *batchingMaxPublishDelay Micros* (producer) | Set the time period within which the messages sent will be batched if batch messages are enabled. If set to a non zero value, messages will be queued until either: this time interval expires the max number of messages in a batch is reached Default is 1ms. | 1000 | long
+| *blockIfQueueFull* (producer) | Set whether the send and asyncSend operations should block when the outgoing message queue is full. If set to false, send operations will immediately fail with ProducerQueueIsFullError when there is no space left in the pending queue. Default is false. | false | boolean
+| *compressionType* (producer) | Set the compression type for the producer. Supported compression types are: NONE: No compression LZ4: Compress with LZ4 algorithm. Faster but lower compression than ZLib ZLI: Standard ZLib compression Default is NONE | NONE | CompressionType
+| *initialSequenceId* (producer) | Set the baseline for the sequence ids for messages published by the producer. First message will be using (initialSequenceId 1) as its sequence id and subsequent messages will be assigned incremental sequence ids, if not otherwise specified. | -1 | long
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *maxPendingMessages* (producer) | Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker. Default is 1000. | 1000 | int
+| *maxPendingMessagesAcross Partitions* (producer) | Set the number of max pending messages across all the partitions. Default is 50000. | 50000 | int
 | *producerName* (producer) | Name of the producer | default-producer | String
+| *sendTimeoutMs* (producer) | Send timeout in milliseconds. Defaults to 30,000ms (30 seconds) | 30000 | int
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
 |===
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
index 82f0232..75fdbf3 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/PulsarEndpointBuilderFactory.java
@@ -407,6 +407,180 @@ public interface PulsarEndpointBuilderFactory {
             return (AdvancedPulsarEndpointProducerBuilder) this;
         }
         /**
+         * Control whether automatic batching of messages is enabled for the
+         * producer. Default is true.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder batchingEnabled(
+                boolean batchingEnabled) {
+            setProperty("batchingEnabled", batchingEnabled);
+            return this;
+        }
+        /**
+         * Control whether automatic batching of messages is enabled for the
+         * producer. Default is true.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder batchingEnabled(
+                String batchingEnabled) {
+            setProperty("batchingEnabled", batchingEnabled);
+            return this;
+        }
+        /**
+         * Set the maximum number of messages permitted in a batch. Default
+         * 1,000.
+         * 
+         * The option is a: <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder batchingMaxMessages(
+                int batchingMaxMessages) {
+            setProperty("batchingMaxMessages", batchingMaxMessages);
+            return this;
+        }
+        /**
+         * Set the maximum number of messages permitted in a batch. Default
+         * 1,000.
+         * 
+         * The option will be converted to a <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder batchingMaxMessages(
+                String batchingMaxMessages) {
+            setProperty("batchingMaxMessages", batchingMaxMessages);
+            return this;
+        }
+        /**
+         * Set the time period within which the messages sent will be batched if
+         * batch messages are enabled. If set to a non zero value, messages will
+         * be queued until either: this time interval expires the max number of
+         * messages in a batch is reached Default is 1ms.
+         * 
+         * The option is a: <code>long</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder batchingMaxPublishDelayMicros(
+                long batchingMaxPublishDelayMicros) {
+            setProperty("batchingMaxPublishDelayMicros", batchingMaxPublishDelayMicros);
+            return this;
+        }
+        /**
+         * Set the time period within which the messages sent will be batched if
+         * batch messages are enabled. If set to a non zero value, messages will
+         * be queued until either: this time interval expires the max number of
+         * messages in a batch is reached Default is 1ms.
+         * 
+         * The option will be converted to a <code>long</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder batchingMaxPublishDelayMicros(
+                String batchingMaxPublishDelayMicros) {
+            setProperty("batchingMaxPublishDelayMicros", batchingMaxPublishDelayMicros);
+            return this;
+        }
+        /**
+         * Set whether the send and asyncSend operations should block when the
+         * outgoing message queue is full. If set to false, send operations will
+         * immediately fail with ProducerQueueIsFullError when there is no space
+         * left in the pending queue. Default is false.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder blockIfQueueFull(
+                boolean blockIfQueueFull) {
+            setProperty("blockIfQueueFull", blockIfQueueFull);
+            return this;
+        }
+        /**
+         * Set whether the send and asyncSend operations should block when the
+         * outgoing message queue is full. If set to false, send operations will
+         * immediately fail with ProducerQueueIsFullError when there is no space
+         * left in the pending queue. Default is false.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder blockIfQueueFull(
+                String blockIfQueueFull) {
+            setProperty("blockIfQueueFull", blockIfQueueFull);
+            return this;
+        }
+        /**
+         * Set the compression type for the producer. Supported compression
+         * types are: NONE: No compression LZ4: Compress with LZ4 algorithm.
+         * Faster but lower compression than ZLib ZLI: Standard ZLib compression
+         * Default is NONE.
+         * 
+         * The option is a:
+         * <code>org.apache.pulsar.client.api.CompressionType</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder compressionType(
+                CompressionType compressionType) {
+            setProperty("compressionType", compressionType);
+            return this;
+        }
+        /**
+         * Set the compression type for the producer. Supported compression
+         * types are: NONE: No compression LZ4: Compress with LZ4 algorithm.
+         * Faster but lower compression than ZLib ZLI: Standard ZLib compression
+         * Default is NONE.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.pulsar.client.api.CompressionType</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder compressionType(
+                String compressionType) {
+            setProperty("compressionType", compressionType);
+            return this;
+        }
+        /**
+         * Set the baseline for the sequence ids for messages published by the
+         * producer. First message will be using (initialSequenceId 1) as its
+         * sequence id and subsequent messages will be assigned incremental
+         * sequence ids, if not otherwise specified.
+         * 
+         * The option is a: <code>long</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder initialSequenceId(
+                long initialSequenceId) {
+            setProperty("initialSequenceId", initialSequenceId);
+            return this;
+        }
+        /**
+         * Set the baseline for the sequence ids for messages published by the
+         * producer. First message will be using (initialSequenceId 1) as its
+         * sequence id and subsequent messages will be assigned incremental
+         * sequence ids, if not otherwise specified.
+         * 
+         * The option will be converted to a <code>long</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder initialSequenceId(
+                String initialSequenceId) {
+            setProperty("initialSequenceId", initialSequenceId);
+            return this;
+        }
+        /**
          * Whether the producer should be started lazy (on the first message).
          * By starting lazy you can use this to allow CamelContext and routes to
          * startup in situations where a producer may otherwise fail during
@@ -447,6 +621,58 @@ public interface PulsarEndpointBuilderFactory {
             return this;
         }
         /**
+         * Set the max size of the queue holding the messages pending to receive
+         * an acknowledgment from the broker. Default is 1000.
+         * 
+         * The option is a: <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder maxPendingMessages(
+                int maxPendingMessages) {
+            setProperty("maxPendingMessages", maxPendingMessages);
+            return this;
+        }
+        /**
+         * Set the max size of the queue holding the messages pending to receive
+         * an acknowledgment from the broker. Default is 1000.
+         * 
+         * The option will be converted to a <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder maxPendingMessages(
+                String maxPendingMessages) {
+            setProperty("maxPendingMessages", maxPendingMessages);
+            return this;
+        }
+        /**
+         * Set the number of max pending messages across all the partitions.
+         * Default is 50000.
+         * 
+         * The option is a: <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder maxPendingMessagesAcrossPartitions(
+                int maxPendingMessagesAcrossPartitions) {
+            setProperty("maxPendingMessagesAcrossPartitions", maxPendingMessagesAcrossPartitions);
+            return this;
+        }
+        /**
+         * Set the number of max pending messages across all the partitions.
+         * Default is 50000.
+         * 
+         * The option will be converted to a <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder maxPendingMessagesAcrossPartitions(
+                String maxPendingMessagesAcrossPartitions) {
+            setProperty("maxPendingMessagesAcrossPartitions", maxPendingMessagesAcrossPartitions);
+            return this;
+        }
+        /**
          * Name of the producer.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -457,6 +683,28 @@ public interface PulsarEndpointBuilderFactory {
             setProperty("producerName", producerName);
             return this;
         }
+        /**
+         * Send timeout in milliseconds. Defaults to 30,000ms (30 seconds).
+         * 
+         * The option is a: <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder sendTimeoutMs(int sendTimeoutMs) {
+            setProperty("sendTimeoutMs", sendTimeoutMs);
+            return this;
+        }
+        /**
+         * Send timeout in milliseconds. Defaults to 30,000ms (30 seconds).
+         * 
+         * The option will be converted to a <code>int</code> type.
+         * 
+         * Group: producer
+         */
+        default PulsarEndpointProducerBuilder sendTimeoutMs(String sendTimeoutMs) {
+            setProperty("sendTimeoutMs", sendTimeoutMs);
+            return this;
+        }
     }
 
     /**
@@ -603,6 +851,18 @@ public interface PulsarEndpointBuilderFactory {
         SHARED,
         FAILOVER;
     }
+
+    /**
+     * Proxy enum for <code>org.apache.pulsar.client.api.CompressionType</code>
+     * enum.
+     */
+    enum CompressionType {
+        NONE,
+        LZ4,
+        ZLIB,
+        ZSTD,
+        SNAPPY;
+    }
     /**
      * Apache Pulsar (camel-pulsar)
      * Camel Apache Pulsar Component