Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,457 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef CONSUMER_HPP_ +#define CONSUMER_HPP_ + +#include <pulsar/BrokerConsumerStats.h> +#include <pulsar/ConsumerConfiguration.h> +#include <pulsar/defines.h> + +#include <iostream> + +namespace pulsar { +class PulsarWrapper; +class ConsumerImplBase; +class PulsarFriend; +typedef std::shared_ptr<ConsumerImplBase> ConsumerImplBasePtr; +/** + * + */ +class PULSAR_PUBLIC Consumer { + public: + /** + * Construct an uninitialized consumer object + */ + Consumer(); + virtual ~Consumer() = default; + + /** + * @return the topic this consumer is subscribed to + */ + const std::string& getTopic() const; + + /** + * @return the consumer name + */ + const std::string& getSubscriptionName() const; + + /** + * Unsubscribe the current consumer from the topic. + * + * This method will block until the operation is completed. Once the consumer is + * unsubscribed, no more messages will be received and subsequent new messages + * will not be retained for this consumer. + * + * This consumer object cannot be reused. + * + * @see asyncUnsubscribe + * @return Result::ResultOk if the unsubscribe operation completed successfully + * @return Result::ResultError if the unsubscribe operation failed + */ + Result unsubscribe(); + + /** + * Asynchronously unsubscribe the current consumer from the topic. + * + * This method will block until the operation is completed. Once the consumer is + * unsubscribed, no more messages will be received and subsequent new messages + * will not be retained for this consumer. + * + * This consumer object cannot be reused. + * + * @param callback the callback to get notified when the operation is complete + */ + void unsubscribeAsync(ResultCallback callback); + + /** + * Receive a single message. + * + * If a message is not immediately available, this method will block until a new + * message is available. + * + * @param msg a non-const reference where the received message will be copied + * @return ResultOk when a message is received + * @return ResultInvalidConfiguration if a message listener had been set in the configuration + */ + Result receive(Message& msg); + + /** + * + * @param msg a non-const reference where the received message will be copied + * @param timeoutMs the receive timeout in milliseconds + * @return ResultOk if a message was received + * @return ResultTimeout if the receive timeout was triggered + * @return ResultInvalidConfiguration if a message listener had been set in the configuration + */ + Result receive(Message& msg, int timeoutMs); + + /** + * Receive a single message + * <p> + * Retrieves a message when it will be available and completes callback with received message. + * </p> + * <p> + * receiveAsync() should be called subsequently once callback gets completed with received message. + * Else it creates <i> backlog of receive requests </i> in the application. + * </p> + * @param ReceiveCallback will be completed when message is available + */ + void receiveAsync(ReceiveCallback callback); + + /** + * Batch receiving messages. + * + * <p>This calls blocks until has enough messages or wait timeout, more details to see {@link + * BatchReceivePolicy}. + * + * @param msgs a non-const reference where the received messages will be copied + * @return ResultOk when a message is received + * @return ResultInvalidConfiguration if a message listener had been set in the configuration + */ + Result batchReceive(Messages& msgs); + + /** + * Async Batch receiving messages. + * <p> + * Retrieves a message when it will be available and completes callback with received message. + * </p> + * <p> + * batchReceiveAsync() should be called subsequently once callback gets completed with received message. + * Else it creates <i> backlog of receive requests </i> in the application. + * </p> + * @param BatchReceiveCallback will be completed when messages are available. + */ + void batchReceiveAsync(BatchReceiveCallback callback); + + /** + * Acknowledge the reception of a single message. + * + * This method will block until an acknowledgement is sent to the broker. After + * that, the message will not be re-delivered to this consumer. + * + * @see asyncAcknowledge + * @param message the message to acknowledge + * @return ResultOk if the message was successfully acknowledged + * @return ResultError if there was a failure + */ + Result acknowledge(const Message& message); + + /** + * Acknowledge the reception of a single message. + * + * This method is blocked until an acknowledgement is sent to the broker. After that, the message is not + * re-delivered to the consumer. + * + * @see asyncAcknowledge + * @param messageId the MessageId to acknowledge + * @return ResultOk if the messageId is successfully acknowledged + */ + Result acknowledge(const MessageId& messageId); + + /** + * Acknowledge the consumption of a list of message. + * @param messageIdList + */ + Result acknowledge(const MessageIdList& messageIdList); + + /** + * Asynchronously acknowledge the reception of a single message. + * + * This method will initiate the operation and return immediately. The provided callback + * will be triggered when the operation is complete. + * + * @param message the message to acknowledge + * @param callback callback that will be triggered when the message has been acknowledged + */ + void acknowledgeAsync(const Message& message, ResultCallback callback); + + /** + * Asynchronously acknowledge the reception of a single message. + * + * This method initiates the operation and returns the result immediately. The provided callback + * is triggered when the operation is completed. + * + * @param messageId the messageId to acknowledge + * @param callback the callback that is triggered when the message has been acknowledged or not + */ + void acknowledgeAsync(const MessageId& messageId, ResultCallback callback); + + /** + * Asynchronously acknowledge the consumption of a list of message. + * @param messageIdList + * @param callback the callback that is triggered when the message has been acknowledged or not + * @return + */ + void acknowledgeAsync(const MessageIdList& messageIdList, ResultCallback callback); + + /** + * Acknowledge the reception of all the messages in the stream up to (and including) + * the provided message. + * + * This method will block until an acknowledgement is sent to the broker. After + * that, the messages will not be re-delivered to this consumer. + * + * Cumulative acknowledge cannot be used when the consumer type is set to ConsumerShared. + * + * It's equivalent to calling asyncAcknowledgeCumulative(const Message&, ResultCallback) and + * waiting for the callback to be triggered. + * + * @param message the last message in the stream to acknowledge + * @return ResultOk if the message was successfully acknowledged. All previously delivered messages for + * this topic are also acknowledged. + * @return ResultError if there was a failure + */ + Result acknowledgeCumulative(const Message& message); + + /** + * Acknowledge the reception of all the messages in the stream up to (and including) + * the provided message. + * + * This method is blocked until an acknowledgement is sent to the broker. After + * that, the message is not re-delivered to this consumer. + * + * Cumulative acknowledge cannot be used when the consumer type is set to ConsumerShared. + * + * It is equivalent to calling the asyncAcknowledgeCumulative(const Message&, ResultCallback) method and + * waiting for the callback to be triggered. + * + * @param messageId the last messageId in the stream to acknowledge + * @return ResultOk if the message is successfully acknowledged. All previously delivered messages for + * this topic are also acknowledged. + */ + Result acknowledgeCumulative(const MessageId& messageId); + + /** + * Asynchronously acknowledge the reception of all the messages in the stream up to (and + * including) the provided message. + * + * This method will initiate the operation and return immediately. The provided callback + * will be triggered when the operation is complete. + * + * @param message the message to acknowledge + * @param callback callback that will be triggered when the message has been acknowledged + */ + void acknowledgeCumulativeAsync(const Message& message, ResultCallback callback); + + /** + * Asynchronously acknowledge the reception of all the messages in the stream up to (and + * including) the provided message. + * + * This method initiates the operation and returns the result immediately. The provided callback + * is triggered when the operation is completed. + * + * @param messageId the messageId to acknowledge + * @param callback the callback that is triggered when the message has been acknowledged or not + */ + void acknowledgeCumulativeAsync(const MessageId& messageId, ResultCallback callback); + + /** + * Acknowledge the failure to process a single message. + * <p> + * When a message is "negatively acked" it will be marked for redelivery after + * some fixed delay. The delay is configurable when constructing the consumer + * with {@link ConsumerConfiguration#setNegativeAckRedeliveryDelayMs}. + * <p> + * This call is not blocking. + * + * <p> + * Example of usage: + * <pre><code> + * while (true) { + * Message msg; + * consumer.receive(msg); + * + * try { + * // Process message... + * + * consumer.acknowledge(msg); + * } catch (Throwable t) { + * log.warn("Failed to process message"); + * consumer.negativeAcknowledge(msg); + * } + * } + * </code></pre> + * + * @param message + * The {@code Message} to be acknowledged + */ + void negativeAcknowledge(const Message& message); + + /** + * Acknowledge the failure to process a single message. + * <p> + * When a message is "negatively acked" it will be marked for redelivery after + * some fixed delay. The delay is configurable when constructing the consumer + * with {@link ConsumerConfiguration#setNegativeAckRedeliveryDelayMs}. + * <p> + * This call is not blocking. + * + * <p> + * Example of usage: + * <pre><code> + * while (true) { + * Message msg; + * consumer.receive(msg); + * + * try { + * // Process message... + * + * consumer.acknowledge(msg); + * } catch (Throwable t) { + * log.warn("Failed to process message"); + * consumer.negativeAcknowledge(msg); + * } + * } + * </code></pre> + * + * @param messageId + * The {@code MessageId} to be acknowledged + */ + void negativeAcknowledge(const MessageId& messageId); + + /** + * Close the consumer and stop the broker to push more messages + */ + Result close(); + + /** + * Asynchronously close the consumer and stop the broker to push more messages + * + */ + void closeAsync(ResultCallback callback); + + /** + * Pause receiving messages via the messageListener, till resumeMessageListener() is called. + */ + Result pauseMessageListener(); + + /** + * Resume receiving the messages via the messageListener. + * Asynchronously receive all the messages enqueued from time pauseMessageListener() was called. + */ + Result resumeMessageListener(); + + /** + * Redelivers all the unacknowledged messages. In Failover mode, the request is ignored if the consumer is + * not + * active for the given topic. In Shared mode, the consumers messages to be redelivered are distributed + * across all + * the connected consumers. This is a non blocking call and doesn't throw an exception. In case the + * connection + * breaks, the messages are redelivered after reconnect. + */ + void redeliverUnacknowledgedMessages(); + + /** + * Gets Consumer Stats from broker. + * The stats are cached for 30 seconds, if a call is made before the stats returned by the previous call + * expires + * then cached data will be returned. BrokerConsumerStats::isValid() function can be used to check if the + * stats are + * still valid. + * + * @param brokerConsumerStats - if the function returns ResultOk, this object will contain consumer stats + * + * @note This is a blocking call with timeout of thirty seconds. + */ + Result getBrokerConsumerStats(BrokerConsumerStats& brokerConsumerStats); + + /** + * Asynchronous call to gets Consumer Stats from broker. + * The stats are cached for 30 seconds, if a call is made before the stats returned by the previous call + * expires + * then cached data will be returned. BrokerConsumerStats::isValid() function can be used to check if the + * stats are + * still valid. + * + * @param callback - callback function to get the brokerConsumerStats, + * if result is ResultOk then the brokerConsumerStats will be populated + */ + void getBrokerConsumerStatsAsync(BrokerConsumerStatsCallback callback); + + /** + * Reset the subscription associated with this consumer to a specific message id. + * The message id can either be a specific message or represent the first or last messages in the topic. + * + * Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the + * seek() on the individual partitions. + * + * @param messageId + * the message id where to reposition the subscription + */ + Result seek(const MessageId& messageId); + + /** + * Reset the subscription associated with this consumer to a specific message publish time. + * + * @param timestamp + * the message publish time where to reposition the subscription + */ + Result seek(uint64_t timestamp); + + /** + * Asynchronously reset the subscription associated with this consumer to a specific message id. + * The message id can either be a specific message or represent the first or last messages in the topic. + * + * Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the + * seek() on the individual partitions. + * + * @param messageId + * the message id where to reposition the subscription + */ + virtual void seekAsync(const MessageId& messageId, ResultCallback callback); + + /** + * Asynchronously reset the subscription associated with this consumer to a specific message publish time. + * + * @param timestamp + * the message publish time where to reposition the subscription + */ + virtual void seekAsync(uint64_t timestamp, ResultCallback callback); + + /** + * @return Whether the consumer is currently connected to the broker + */ + bool isConnected() const; + + /** + * Asynchronously get an ID of the last available message or a message ID with -1 as an entryId if the + * topic is empty. + */ + void getLastMessageIdAsync(GetLastMessageIdCallback callback); + + /** + * Get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty. + */ + Result getLastMessageId(MessageId& messageId); + + private: + ConsumerImplBasePtr impl_; + explicit Consumer(ConsumerImplBasePtr); + + friend class PulsarFriend; + friend class PulsarWrapper; + friend class MultiTopicsConsumerImpl; + friend class ConsumerImpl; + friend class ClientImpl; + friend class ConsumerTest; +}; +} // namespace pulsar + +#endif /* CONSUMER_HPP_ */
Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZkACgkQT0AbyNP5 ++1XmNQ/+IbL5sGTeIkR7PcXLoi+3VL1d5raOM00qqrrgDPISYRLdTsxgM4orFEFY +GnLbSC3d9RJUTXJbRL7le3oiNXPGPr7LpbGw1Mw+W1H21dNQerpoBU+UHi2W35JZ +2QxzC4VsaUuwo5w0EBHInBNlAVCktHUdQDjBRWdTcovLC0fCIgOK7S4Ps8EdEPWS +ojQITcFWPfS1kEYcaGVjsoWBAanHc0zYR4YCON3Wbh5k7bpBtfWbl0mHlf/L3XHQ +O1nK+malJHkXa5pBkzQGAsonIA75A2NCrZ4onHO8MpmWIS3G5tutCQEl9hY7k21c +slG1xK2Ix6+ff9iQI/M0zlC2/pNxMoI+FebGH6k//Rs0tO9c0qrEn1iwjWOkpLQx +q3wP3NGOrM7qlk6tt6DSq67nZUmjXJJ5B829Sb0MBxVBaw/R4UTlLreioXxRbq3S +RhGnTxlP63sRgaXLtZM+8JZWjb1EXqPx4RMUHB8dLCwuUH8P9ySyF/DnXPbJKldT +ejbNTYUNVcXcSnnS6/bpFyu060Px0dXv5l5Mb8lfQhkcfggqT8D9RiCVbMzKJR3J +0kNcthV+a9Aj4bcVXiMUTGwBaqEkY5QAQJ4pdY2pZW14dNMsO82guiE0UzRk4ywA +KleQfvqj9EXI8gCP/6hdTxbgF8TXBA/oYQZ62KuOcNvwJuPQtSQ= +=qdBZ +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Consumer.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +0779b4d0473e694e53b184c6bc1f66901d10ebd48feec2bda85263a994ca4bf801fc98874378ab48778951c59a172733b038189ec2faf54bc4e67e0581e15cdb ./x64-windows-static/include/pulsar/Consumer.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,562 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef PULSAR_CONSUMERCONFIGURATION_H_ +#define PULSAR_CONSUMERCONFIGURATION_H_ + +#include <pulsar/ConsumerCryptoFailureAction.h> +#include <pulsar/ConsumerEventListener.h> +#include <pulsar/ConsumerType.h> +#include <pulsar/CryptoKeyReader.h> +#include <pulsar/InitialPosition.h> +#include <pulsar/KeySharedPolicy.h> +#include <pulsar/Message.h> +#include <pulsar/Result.h> +#include <pulsar/Schema.h> +#include <pulsar/defines.h> + +#include <functional> +#include <memory> + +#include "BatchReceivePolicy.h" + +namespace pulsar { + +class Consumer; +class PulsarWrapper; + +/// Callback definition for non-data operation +typedef std::vector<Message> Messages; +typedef std::function<void(Result result)> ResultCallback; +typedef std::function<void(Result, const Message& msg)> ReceiveCallback; +typedef std::function<void(Result, const Messages& msgs)> BatchReceiveCallback; +typedef std::function<void(Result result, MessageId messageId)> GetLastMessageIdCallback; + +/// Callback definition for MessageListener +typedef std::function<void(Consumer consumer, const Message& msg)> MessageListener; + +typedef std::shared_ptr<ConsumerEventListener> ConsumerEventListenerPtr; + +struct ConsumerConfigurationImpl; + +/** + * Class specifying the configuration of a consumer. + */ +class PULSAR_PUBLIC ConsumerConfiguration { + public: + ConsumerConfiguration(); + ~ConsumerConfiguration(); + ConsumerConfiguration(const ConsumerConfiguration&); + ConsumerConfiguration& operator=(const ConsumerConfiguration&); + + /** + * Create a new instance of ConsumerConfiguration with the same + * initial settings as the current one. + */ + ConsumerConfiguration clone() const; + + /** + * Declare the schema of the data that this consumer will be accepting. + * + * The schema will be checked against the schema of the topic, and the + * consumer creation will fail if it's not compatible. + * + * @param schemaInfo the schema definition object + */ + ConsumerConfiguration& setSchema(const SchemaInfo& schemaInfo); + + /** + * @return the schema information declared for this consumer + */ + const SchemaInfo& getSchema() const; + + /** + * Specify the consumer type. The consumer type enables + * specifying the type of subscription. In Exclusive subscription, + * only a single consumer is allowed to attach to the subscription. Other consumers + * will get an error message. In Shared subscription, multiple consumers will be + * able to use the same subscription name and the messages will be dispatched in a + * round robin fashion. In Failover subscription, a primary-failover subscription model + * allows for multiple consumers to attach to a single subscription, though only one + * of them will be âmasterâ at a given time. Only the primary consumer will receive + * messages. When the primary consumer gets disconnected, one among the failover + * consumers will be promoted to primary and will start getting messages. + */ + ConsumerConfiguration& setConsumerType(ConsumerType consumerType); + + /** + * @return the consumer type + */ + ConsumerType getConsumerType() const; + + /** + * Set KeyShared subscription policy for consumer. + * + * By default, KeyShared subscription use auto split hash range to maintain consumers. If you want to + * set a different KeyShared policy, you can set by following example: + * + * @param keySharedPolicy The {@link KeySharedPolicy} want to specify + */ + ConsumerConfiguration& setKeySharedPolicy(KeySharedPolicy keySharedPolicy); + + /** + * @return the KeyShared subscription policy + */ + KeySharedPolicy getKeySharedPolicy() const; + + /** + * A message listener enables your application to configure how to process + * and acknowledge messages delivered. A listener will be called in order + * for every message received. + */ + ConsumerConfiguration& setMessageListener(MessageListener messageListener); + + /** + * @return the message listener + */ + MessageListener getMessageListener() const; + + /** + * @return true if the message listener has been set + */ + bool hasMessageListener() const; + + /** + * A event listener enables your application to react the consumer state + * change event (active or inactive). + */ + ConsumerConfiguration& setConsumerEventListener(ConsumerEventListenerPtr eventListener); + + /** + * @return the consumer event listener + */ + ConsumerEventListenerPtr getConsumerEventListener() const; + + /** + * @return true if the consumer event listener has been set + */ + bool hasConsumerEventListener() const; + + /** + * Sets the size of the consumer receive queue. + * + * The consumer receive queue controls how many messages can be accumulated by the consumer before the + * application calls receive(). Using a higher value may potentially increase the consumer throughput + * at the expense of bigger memory utilization. + * + * Setting the consumer queue size to 0 decreases the throughput of the consumer by disabling + * pre-fetching of + * messages. This approach improves the message distribution on shared subscription by pushing messages + * only to + * the consumers that are ready to process them. Neither receive with timeout nor partitioned topics can + * be + * used if the consumer queue size is 0. The receive() function call should not be interrupted when + * the consumer queue size is 0. + * + * The default value is 1000 messages and it is appropriate for the most use cases. + * + * @param size the new receiver queue size value + * + */ + void setReceiverQueueSize(int size); + + /** + * @return the receiver queue size + */ + int getReceiverQueueSize() const; + + /** + * Set the max total receiver queue size across partitons. + * + * This setting is used to reduce the receiver queue size for individual partitions + * {@link #setReceiverQueueSize(int)} if the total exceeds this value (default: 50000). + * + * @param maxTotalReceiverQueueSizeAcrossPartitions + */ + void setMaxTotalReceiverQueueSizeAcrossPartitions(int maxTotalReceiverQueueSizeAcrossPartitions); + + /** + * @return the configured max total receiver queue size across partitions + */ + int getMaxTotalReceiverQueueSizeAcrossPartitions() const; + + /** + * Set the consumer name. + * + * @param consumerName + */ + void setConsumerName(const std::string& consumerName); + + /** + * @return the consumer name + */ + const std::string& getConsumerName() const; + + /** + * Set the timeout in milliseconds for unacknowledged messages, the timeout needs to be greater than + * 10 seconds. An Exception is thrown if the given value is less than 10000 (10 seconds). + * If a successful acknowledgement is not sent within the timeout all the unacknowledged messages are + * redelivered. + * + * Default: 0, which means the the tracker for unacknowledged messages is disabled. + * + * @param timeout in milliseconds + */ + void setUnAckedMessagesTimeoutMs(const uint64_t milliSeconds); + + /** + * @return the configured timeout in milliseconds for unacked messages. + */ + long getUnAckedMessagesTimeoutMs() const; + + /** + * Set the tick duration time that defines the granularity of the ack-timeout redelivery (in + * milliseconds). + * + * The default value is 1000, which means 1 second. + * + * Using a higher tick time reduces + * the memory overhead to track messages when the ack-timeout is set to a bigger value. + * + * @param milliSeconds the tick duration time (in milliseconds) + */ + void setTickDurationInMs(const uint64_t milliSeconds); + + /** + * @return the tick duration time (in milliseconds) + */ + long getTickDurationInMs() const; + + /** + * Set the delay to wait before re-delivering messages that have failed to be process. + * + * When application uses {@link Consumer#negativeAcknowledge(Message)}, the failed message + * will be redelivered after a fixed timeout. The default is 1 min. + * + * @param redeliveryDelay + * redelivery delay for failed messages + * @param timeUnit + * unit in which the timeout is provided. + * @return the consumer builder instance + */ + void setNegativeAckRedeliveryDelayMs(long redeliveryDelayMillis); + + /** + * Get the configured delay to wait before re-delivering messages that have failed to be process. + * + * @return redelivery delay for failed messages + */ + long getNegativeAckRedeliveryDelayMs() const; + + /** + * Set time window in milliseconds for grouping message ACK requests. An ACK request is not sent + * to broker until the time window reaches its end, or the number of grouped messages reaches + * limit. Default is 100 milliseconds. If it's set to a non-positive value, ACK requests will be + * directly sent to broker without grouping. + * + * @param ackGroupMillis time of ACK grouping window in milliseconds. + */ + void setAckGroupingTimeMs(long ackGroupingMillis); + + /** + * Get grouping time window in milliseconds. + * + * @return grouping time window in milliseconds. + */ + long getAckGroupingTimeMs() const; + + /** + * Set max number of grouped messages within one grouping time window. If it's set to a + * non-positive value, number of grouped messages is not limited. Default is 1000. + * + * @param maxGroupingSize max number of grouped messages with in one grouping time window. + */ + void setAckGroupingMaxSize(long maxGroupingSize); + + /** + * Get max number of grouped messages within one grouping time window. + * + * @return max number of grouped messages within one grouping time window. + */ + long getAckGroupingMaxSize() const; + + /** + * Set the time duration for which the broker side consumer stats will be cached in the client. + * + * Default: 30000, which means 30 seconds. + * + * @param cacheTimeInMs in milliseconds + */ + void setBrokerConsumerStatsCacheTimeInMs(const long cacheTimeInMs); + + /** + * @return the configured timeout in milliseconds caching BrokerConsumerStats. + */ + long getBrokerConsumerStatsCacheTimeInMs() const; + + /** + * @return true if encryption keys are added + */ + bool isEncryptionEnabled() const; + + /** + * @return the shared pointer to CryptoKeyReader. + */ + const CryptoKeyReaderPtr getCryptoKeyReader() const; + + /** + * Set the shared pointer to CryptoKeyReader. + * + * @param the shared pointer to CryptoKeyReader + */ + ConsumerConfiguration& setCryptoKeyReader(CryptoKeyReaderPtr cryptoKeyReader); + + /** + * @return the ConsumerCryptoFailureAction + */ + ConsumerCryptoFailureAction getCryptoFailureAction() const; + + /** + * Set the ConsumerCryptoFailureAction. + */ + ConsumerConfiguration& setCryptoFailureAction(ConsumerCryptoFailureAction action); + + /** + * @return true if readCompacted is enabled + */ + bool isReadCompacted() const; + + /** + * If enabled, the consumer reads messages from the compacted topics rather than reading the full message + * backlog of the topic. This means that if the topic has been compacted, the consumer only sees the + * latest value for each key in the topic, up until the point in the topic message backlog that has been + * compacted. Beyond that point, message is sent as normal. + * + * `readCompacted` can only be enabled subscriptions to persistent topics, which have a single active + * consumer (for example, failure or exclusive subscriptions). Attempting to enable it on subscriptions to + * a non-persistent topics or on a shared subscription leads to the subscription call failure. + * + * @param readCompacted + * whether to read from the compacted topic + */ + void setReadCompacted(bool compacted); + + /** + * Set the time duration in minutes, for which the PatternMultiTopicsConsumer will do a pattern auto + * discovery. + * The default value is 60 seconds. less than 0 will disable auto discovery. + * + * @param periodInSeconds period in seconds to do an auto discovery + */ + void setPatternAutoDiscoveryPeriod(int periodInSeconds); + + /** + * @return the time duration for the PatternMultiTopicsConsumer performs a pattern auto discovery + */ + int getPatternAutoDiscoveryPeriod() const; + + /** + * The default value is `InitialPositionLatest`. + * + * @param subscriptionInitialPosition the initial position at which to set + * the cursor when subscribing to the topic for the first time + */ + void setSubscriptionInitialPosition(InitialPosition subscriptionInitialPosition); + + /** + * @return the configured `InitialPosition` for the consumer + */ + InitialPosition getSubscriptionInitialPosition() const; + + /** + * Set batch receive policy. + * + * @param batchReceivePolicy the default is + * {maxNumMessage: -1, maxNumBytes: 10 * 1024 * 1024, timeoutMs: 100} + */ + void setBatchReceivePolicy(const BatchReceivePolicy& batchReceivePolicy); + + /** + * Get batch receive policy. + * + * @return batch receive policy + */ + const BatchReceivePolicy& getBatchReceivePolicy() const; + + /** + * Set whether the subscription status should be replicated. + * The default value is `false`. + * + * @param replicateSubscriptionState whether the subscription status should be replicated + */ + void setReplicateSubscriptionStateEnabled(bool enabled); + + /** + * @return whether the subscription status should be replicated + */ + bool isReplicateSubscriptionStateEnabled() const; + + /** + * Check whether the message has a specific property attached. + * + * @param name the name of the property to check + * @return true if the message has the specified property + * @return false if the property is not defined + */ + bool hasProperty(const std::string& name) const; + + /** + * Get the value of a specific property + * + * @param name the name of the property + * @return the value of the property or null if the property was not defined + */ + const std::string& getProperty(const std::string& name) const; + + /** + * Get all the properties attached to this producer. + */ + std::map<std::string, std::string>& getProperties() const; + + /** + * Sets a new property on a message. + * @param name the name of the property + * @param value the associated value + */ + ConsumerConfiguration& setProperty(const std::string& name, const std::string& value); + + /** + * Add all the properties in the provided map + */ + ConsumerConfiguration& setProperties(const std::map<std::string, std::string>& properties); + + /** + * Get all the subscription properties attached to this subscription. + */ + std::map<std::string, std::string>& getSubscriptionProperties() const; + + /** + * Sets a new subscription properties for this subscription. + * Notice: SubscriptionProperties are immutable, and consumers under the same subscription will fail to + * create a subscription if they use different properties. + * + * @param subscriptionProperties all the subscription properties in the provided map + */ + ConsumerConfiguration& setSubscriptionProperties( + const std::map<std::string, std::string>& subscriptionProperties); + + /** + * Set the Priority Level for consumer (0 is the default value and means the highest priority). + * + * @param priorityLevel the priority of this consumer + * @return the ConsumerConfiguration instance + */ + ConsumerConfiguration& setPriorityLevel(int priorityLevel); + + /** + * @return the configured priority for the consumer + */ + int getPriorityLevel() const; + + /** + * Consumer buffers chunk messages into memory until it receives all the chunks of the original message. + * While consuming chunk-messages, chunks from same message might not be contiguous in the stream and they + * might be mixed with other messages' chunks. so, consumer has to maintain multiple buffers to manage + * chunks coming from different messages. This mainly happens when multiple publishers are publishing + * messages on the topic concurrently or publisher failed to publish all chunks of the messages. + * + * eg: M1-C1, M2-C1, M1-C2, M2-C2 + * Here, Messages M1-C1 and M1-C2 belong to original message M1, M2-C1 and M2-C2 belong to M2 message. + * + * Buffering large number of outstanding uncompleted chunked messages can create memory pressure and it + * can be guarded by providing this maxPendingChunkedMessage threshold. Once, consumer reaches this + * threshold, it drops the outstanding unchunked-messages by silently acking or asking broker to redeliver + * later by marking it unacked. See setAutoAckOldestChunkedMessageOnQueueFull. + * + * If it's zero, the pending chunked messages will not be limited. + * + * Default: 10 + * + * @param maxPendingChunkedMessage the number of max pending chunked messages + */ + ConsumerConfiguration& setMaxPendingChunkedMessage(size_t maxPendingChunkedMessage); + + /** + * The associated getter of setMaxPendingChunkedMessage + */ + size_t getMaxPendingChunkedMessage() const; + + /** + * Buffering large number of outstanding uncompleted chunked messages can create memory pressure and it + * can be guarded by providing the maxPendingChunkedMessage threshold. See setMaxPendingChunkedMessage. + * Once, consumer reaches this threshold, it drops the outstanding unchunked-messages by silently acking + * if autoAckOldestChunkedMessageOnQueueFull is true else it marks them for redelivery. + * + * Default: false + * + * @param autoAckOldestChunkedMessageOnQueueFull whether to ack the discarded chunked message + */ + ConsumerConfiguration& setAutoAckOldestChunkedMessageOnQueueFull( + bool autoAckOldestChunkedMessageOnQueueFull); + + /** + * The associated getter of setAutoAckOldestChunkedMessageOnQueueFull + */ + bool isAutoAckOldestChunkedMessageOnQueueFull() const; + + /** + * If producer fails to publish all the chunks of a message then consumer can expire incomplete chunks if + * consumer won't be able to receive all chunks in expire times. Use value 0 to disable this feature. + * + * Default: 60000, which means 1 minutes + * + * @param expireTimeOfIncompleteChunkedMessageMs expire time in milliseconds + * @return Consumer Configuration + */ + ConsumerConfiguration& setExpireTimeOfIncompleteChunkedMessageMs( + long expireTimeOfIncompleteChunkedMessageMs); + + /** + * + * Get the expire time of incomplete chunked message in milliseconds + * + * @return the expire time of incomplete chunked message in milliseconds + */ + long getExpireTimeOfIncompleteChunkedMessageMs() const; + + /** + * Set the consumer to include the given position of any reset operation like Consumer::seek. + * + * Default: false + * + * @param startMessageIdInclusive whether to include the reset position + */ + ConsumerConfiguration& setStartMessageIdInclusive(bool startMessageIdInclusive); + + /** + * The associated getter of setStartMessageIdInclusive + */ + bool isStartMessageIdInclusive() const; + + friend class PulsarWrapper; + + private: + std::shared_ptr<ConsumerConfigurationImpl> impl_; +}; +} // namespace pulsar +#endif /* PULSAR_CONSUMERCONFIGURATION_H_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZkACgkQT0AbyNP5 ++1WOtA/+KJbPkXoKAslDSq2U8yfTUkWD/ncHvu+GwRREXnGHbnpVE2S1C+Ze9EdM +QYL8w7ffTcWxRBKEYMAuhl9lLWxpRpJEsNDdDdNUbeZ9n61dq9qLnRXZH2L64UQV +7zEzcxNZcRf/VTSd1tigEXRUvZK2/9Z0NNxXn3nGohSdhg9PH7zD+s2YqcaPkQHR +nZFUIHvnJVl6ve6qnNpRMgx8ef9NFO8cgpzigpk1H3BWYdeX9IL4nA0NozL8GqNZ +9ysv1pFvc2hNXT4CUnYhCU4EJS48CXcdI6F3qyXQfSmbfBXnMdfMxAmAo3qRMol+ +0t+buYaoqrDX62/zimOiVz9BB8jGhgmRry4FAihQjCSGZn/yBQ/24P8tO1897aLQ +0p62SM6vUDJzTRQQlmRT0wWfY9l4noLU0cq9G3gdER8vOgrQ34F/ziS28LsiTlVk +UXjhNdnSN75iOQD+95CLhEy2KZXxgB4kdrpYTVWRBviD6fIJP3cgNflYtb5Pt6Od +gL1SwuQZZrnGwdz9q/LxtfiXaBpeAPgfYSdVEIiYg9zmvFHZvnCwV4GwrE+tiCDP +9Fh+/mzzLIamP2fHnKzEuzwMvAj/riuyldcQxDeWAc8Sox5vnelX/pDLrflivUfk +CKPS9tczB0Cifx/bp1zykRISjGHn8WVhC8HBJrEocXLzh0MaL+c= +=JWRV +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerConfiguration.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +405f33099de51b46c25f543b518e2889a197e3674567b6d0c0c545a10a3a49c38217e1cb1d17c73322acfb457a7baa8c699a485e52ef2aa9adc6d51ceddc5480 ./x64-windows-static/include/pulsar/ConsumerConfiguration.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef CONSUMERCRYPTOFAILUREACTION_H_ +#define CONSUMERCRYPTOFAILUREACTION_H_ + +namespace pulsar { + +enum class ConsumerCryptoFailureAction +{ + FAIL, // This is the default option to fail consume until crypto succeeds + DISCARD, // Message is silently acknowledged and not delivered to the application + CONSUME // Deliver the encrypted message to the application. It's the application's + // responsibility to decrypt the message. If message is also compressed, + // decompression will fail. If message contain batch messages, client will + // not be able to retrieve individual messages in the batch +}; + +} /* namespace pulsar */ + +#endif /* CONSUMERCRYPTOFAILUREACTION_H_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZYACgkQT0AbyNP5 ++1USKQ//d02xyDuLX5QfHryNd/6vaE7YFsDT3/83h2yLQ5rFJJPsQ7uAUzpgfhs+ +70YIdNTiFKM3tbKobKKHAWKvC3wS6HjC6CUhPC3qv9KYttz6FCN7MV6vRnImc3p8 +DpHN3KTOJ6jRtZC3KZHC+NvlwRK0WnR5L8+dK5NpUAj9/GqPS+Xg6NFeOISPNYH6 +DO+HAPTS2eCg5aCUBwKUDsBmF2vIjaAA11RGi5iqSunAA/qXu6uvgIjCPKQlOFki +pE9X0pQLn8zORA1QtNEB5LIlaycWzVxJE4INa7Gf/2oU17p2quhxrDT4saTi4LGL +LpB47e/MrfSMCvWJBLJqClZRIDmRQdL9TVy3kOPdSVdKf3i0GN9xWG+n4ULx1wu6 +nBuW2jgrMbO+ZrhRsE9bxvBpCYmSn0YAbJPB5p9YcTUkKX6Qn4qeHJ6eepSJhn+E +X+SmjVv2D9cPjylD7XhkJshJg6rLdWcAsrOYf/vvxM9JGFUbIaNwOBLDCkvjSTW0 +vVrEAH0WdkCoEwQqSabNM1j4SHzzEhTdm6OPQ+Rh6hXAyhKbXzwqZ2eP/l1gtibs +iv4gEGz/JbiUWn59hDerU2yqjNNO4VnstYrgXN6wRwbIpT3VLn6Z80Q2h5qW1oOC +JgPMYRFEAfZl3PdSz3osFDJ3UEZWGVydmXBQT9otoRpjyplWoP0= +=xO1B +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +c8f532cc7d2e88c606e1b5c2389a49f87a3ee8db5f9d489a230830be2d55beb703159319f8e85376eba238d6a0251751421d19e31219a00a7dcf0bdcdea10bba ./x64-windows-static/include/pulsar/ConsumerCryptoFailureAction.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef PULSAR_CONSUMEREVENTLISTENER_H_ +#define PULSAR_CONSUMEREVENTLISTENER_H_ + +#include <pulsar/defines.h> + +namespace pulsar { + +class Consumer; + +class PULSAR_PUBLIC ConsumerEventListener { + public: + virtual ~ConsumerEventListener(){}; + /** + * @brief Notified when the consumer group is changed, and the consumer becomes active. + * + * @param consumer the consumer that originated the event + * @param partitionId the id of the partition that beconmes active. + */ + virtual void becameActive(Consumer consumer, int partitionId) = 0; + + /** + * @brief Notified when the consumer group is changed, and the consumer is still inactive or becomes + * inactive. + * + * @param consumer the consumer that originated the event + * @param partitionId the id of the partition that is still inactive or becomes inactive. + */ + virtual void becameInactive(Consumer consumer, int partitionId) = 0; +}; +} // namespace pulsar +#endif /* PULSAR_CONSUMEREVENTLISTENER_H_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZYACgkQT0AbyNP5 ++1XE9xAAoFV5TuW591J0txNjXNE6fUoM1pES+opkG1q1JuoVVf+yXsYDeP89TN03 +6KwpNlLeXSNfU/m8Is4G7uGbl5mwcVqOgX01F+Qm+mIcUqQGBbZEcNOV4HaMhuxs +S0nywS6wIzEWZas5T1TERPgMx7jqOhwWuHxZQo8nOvCS2PHWCwwVFFbSRmZphzuf +KZJg2d8YgidqjL2UB3fiNZd5KE6y328X38hWW5BPY1ZJzZKSq3NqjJYT1tR7jZyD +ghVia9OEcyIHgpiLso72mWvfZXQ40rdiGrdOM3BGbQ3a9TG6sa3Vl8dzSA+m923P +kEoqLaDHLFCWtfsQpZp405K6libiFloC4j83fE3YSKoOjfc7XOVJRemwqaQkL+RP +P8JijlzO2rzJ3OvatwJlPb6NmyBtNIPwBg8KbZSrurgcBnOszuu1G45mDHDV0QHz +1nbPbVUzZbtqkBfKm5gCXx6sup23kOJ+TqYXy7PsNMtSM7juGmvarciCqKMUj7T0 +WXeEuFQBwlMe2aEEEannZltfWEgx2XkC+kp31eamRLoffRJdUgPg8AuGcF/jhJ6t +9VmsvNslspcxlYJRyX11RVmYKfs0mmbulpm90WkLjtzGj8/WlzO9/4ys6co40lY5 +RxPDxXZM+V2E6TPcfyEDFmmbamBHwM4pvewBwf2v8kq1pbBOU1g= +=0lbr +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerEventListener.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +d6efec4e607f673e20a5f47f123c298af483699f94de6c4550370584d4ff25234b1939e4ea5beb0defc76ca33eaec3aa545c09595c7b5a79579fd2a2a7d3fd0d ./x64-windows-static/include/pulsar/ConsumerEventListener.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef PULSAR_CPP_CONSUMERTYPE_H +#define PULSAR_CPP_CONSUMERTYPE_H + +namespace pulsar { +enum ConsumerType +{ + /** + * There can be only 1 consumer on the same topic with the same consumerName + */ + ConsumerExclusive, + + /** + * Multiple consumers will be able to use the same consumerName and the messages + * will be dispatched according to a round-robin rotation between the connected consumers + */ + ConsumerShared, + + /** Only one consumer is active on the subscription; Subscription can have N consumers + * connected one of which will get promoted to master if the current master becomes inactive + */ + ConsumerFailover, + + /** + * Multiple consumer will be able to use the same subscription and all messages with the same key + * will be dispatched to only one consumer + */ + ConsumerKeyShared +}; +} + +#endif // PULSAR_CPP_CONSUMERTYPE_H Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZgACgkQT0AbyNP5 ++1WAEw/+MW/cha9wG/vYikeI1zL6wYhTpWDSxUqeS8Rqd+u3m7hkvGDlzoPt6JJb +QD1sHnSEnHBqFSOVCE3LOYV8vm5K9Mjuf30H1+po7sLL6Usl+XZz3eLbDzceZMOb +NFyFx1HOSfK+YLvDGVLHoUPghJD9sKYEJNwE8ucDuTu41CPlRyiihat4ykChx1BO +n9rD13Px+e9SUzsjZf7Q+UFcQRK8i9NQ9zuQv1KBIbuETWFepM5EFMqtQcHFvYW+ +JPc3C4ihcAEYK/hwWvf9ZcoSu7ucbjgkRqQoEYGv5hunDucFNmMuDw0gWlydUmVx +5dFZapsj0+r+LbKoLCQGkZHBscYDCnGqJqF7ZThrXoFfnsluz3WRgSID8J+Ax7c5 +AXgzudM2UQYQnoqsxkreHiIq/FVa5OcnROtoIfaSVOB5b8LX5aNMmOwB5r6tvNFs +Akzn/OZ+cJjbFeZj/1Ec6vITsj2kaWoT475hKb+wkU3JbW6IJix9v6NFtOHqVk0e +ynNZOqaPLQJCzdPV2WSPPYd5KjGcCR8WCVhfQfAr+ammRSlRWFW6LdQa2AprJ5ht +F5+84MCSwTIMn0Lg559mqKPM3RfniA3RZ0fqA9WJVlXRdyNuTbnnM5PC8S2HKcHO +OtOLnxbm7GMeOcBKVhKj1QsC8FjhayAg/FLFvzrvMeefTKTFvsQ= +=RunN +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ConsumerType.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +bc92ef22da64c22a2e385d2beb085129a6b78255a3222525030841b70dfd2d85c02acb87b510137e91225e64b5eb5407fe2c0c9d998a3e5b685b84011ea596c8 ./x64-windows-static/include/pulsar/ConsumerType.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,123 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef CRYPTOKEYREADER_H_ +#define CRYPTOKEYREADER_H_ + +#include <pulsar/EncryptionKeyInfo.h> +#include <pulsar/Result.h> +#include <pulsar/defines.h> + +namespace pulsar { + +/** + * The abstract class that abstracts the access to a key store + */ +class PULSAR_PUBLIC CryptoKeyReader { + public: + CryptoKeyReader(); + virtual ~CryptoKeyReader(); + + /** + * Return the encryption key corresponding to the key name in the argument + * <p> + * This method should be implemented to return the EncryptionKeyInfo. This method will be + * called at the time of producer creation as well as consumer receiving messages. + * Hence, application should not make any blocking calls within the implementation. + * <p> + * + * @param keyName + * Unique name to identify the key + * @param metadata + * Additional information needed to identify the key + * @param encKeyInfo updated with details about the public key + * @return Result ResultOk is returned for success + * + */ + virtual Result getPublicKey(const std::string& keyName, std::map<std::string, std::string>& metadata, + EncryptionKeyInfo& encKeyInfo) const = 0; + + /** + * @param keyName + * Unique name to identify the key + * @param metadata + * Additional information needed to identify the key + * @param encKeyInfo updated with details about the private key + * @return Result ResultOk is returned for success + */ + virtual Result getPrivateKey(const std::string& keyName, std::map<std::string, std::string>& metadata, + EncryptionKeyInfo& encKeyInfo) const = 0; + +}; /* namespace pulsar */ + +typedef std::shared_ptr<CryptoKeyReader> CryptoKeyReaderPtr; + +class PULSAR_PUBLIC DefaultCryptoKeyReader : public CryptoKeyReader { + private: + std::string publicKeyPath_; + std::string privateKeyPath_; + void readFile(std::string fileName, std::string& fileContents) const; + + public: + /** + * The constructor of {@link #CryptoKeyReader} + * + * Configure the key reader to be used to decrypt the message payloads + * + * @param publicKeyPath the path to the public key + * @param privateKeyPath the path to the private key + * @since 2.8.0 + */ + DefaultCryptoKeyReader(const std::string& publicKeyPath, const std::string& privateKeyPath); + ~DefaultCryptoKeyReader(); + + /** + * Return the encryption key corresponding to the key name in the argument. + * + * This method should be implemented to return the EncryptionKeyInfo. This method is called when creating + * producers as well as allowing consumers to receive messages. Consequently, the application should not + * make any blocking calls within the implementation. + * + * @param[in] keyName + * the unique name to identify the key + * @param[in] metadata + * the additional information needed to identify the key + * @param[out] encKeyInfo the EncryptionKeyInfo with details about the public key + * @return ResultOk + */ + Result getPublicKey(const std::string& keyName, std::map<std::string, std::string>& metadata, + EncryptionKeyInfo& encKeyInfo) const; + + /** + * Return the encryption key corresponding to the key name in the argument. + * + * @param[in] keyName + * the unique name to identify the key + * @param[in] metadata + * the additional information needed to identify the key + * @param[out] encKeyInfo the EncryptionKeyInfo with details about the private key + * @return ResultOk + */ + Result getPrivateKey(const std::string& keyName, std::map<std::string, std::string>& metadata, + EncryptionKeyInfo& encKeyInfo) const; + static CryptoKeyReaderPtr create(const std::string& publicKeyPath, const std::string& privateKeyPath); +}; /* namespace pulsar */ + +} // namespace pulsar + +#endif /* CRYPTOKEYREADER_H_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZkACgkQT0AbyNP5 ++1VfARAAgHIP2QUrL4NFz2Daw+fY0mgDIYiH9LwIJhtQPpjnmoFbunUEgJgmelnb +eMNxzsK8Poh8L+MlHwzTT1Lal8aJVqi8J1DiPC2Fzkh1Q5G7M/LEnhR+hiQ/f2Da +x3j4QNmf+RDeYybArCCG7JwxT4UdGkBFWr95bUIto987X8g8tXDtfYw30was4014 +4J9aUqwTy8xfNXyZiqRTLQ32q3bJnbDe+eJH9E6HefyrvDcpMsWf9OWol6KJOrwe +OuQWvks0ODh/0IOQyouAeZ2vT2AIbJEhjejbP20zry/ajolb3Nv2eI2/gZJUezhV +cMG6+cmKiRXS/UPaoRauQvDtQ2Qxu7v5ICXSOzJjzyqe5lY7v0U6e9+lXePEZsRW +X1L1pB/mqwXjzv5NdP82h/8rpyC59m2nRVJBDkqtbTazezUnpXCKLyrVWbe9ovl1 +ltdWv2iW1XCNY3wnoEmExb6ZIMhorCACrky2uQyJFIQV408Ngbe2KAaDVji2peQl +ytjcvEjPARzh5xSa6HkvFqYPEdAKR5Fu3aFeTvOsrv+Ok8D/b4+vJEybSfC8zVWR +JduVN5n5xgRpgA8cKkpjXnNNwEDaGpunzJcLxV3H9OV+pZ9X5GLmLWvihvGjKs0q +8slTI0shoUqqwTCfaBHHgrwB8qyLwajfJunsPOEaeGZNEvtCZu8= +=g7bd +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/CryptoKeyReader.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +44e13c8064218c736bc905a1745de3b68a5a4abe560da39b8487796619dd87705f0dc084eca5a292dbdfb5fd6a3e038ec92c641fcc21f75c67b8202f7be7aa71 ./x64-windows-static/include/pulsar/CryptoKeyReader.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,37 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef DEPRECATED_EXCEPTION_HPP_ +#define DEPRECATED_EXCEPTION_HPP_ + +#include <pulsar/defines.h> + +#include <stdexcept> +#include <string> + +namespace pulsar { +class PULSAR_PUBLIC DeprecatedException : public std::runtime_error { + public: + explicit DeprecatedException(const std::string& __arg); + + private: + static const std::string message_prefix; +}; +} // namespace pulsar + +#endif // DEPRECATED_EXCEPTION_HPP_ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZUACgkQT0AbyNP5 ++1W1pA/8C/49MEbnZyfRiO5oxOfrsKKSHaW5gVWohTqzel3HISyEcTXj/9SM6Xz8 +1ILO6gwMTS9d+luy0Qg4HFIuuTTlZqahiJFMLqPIO+LdShCV/4Bpzj17wVcSo6Dk +E5cHj/PpKY12zOvZWNsjHA7zvrNT1OMOFSoL/IqUxPeYGl4JEe6SEYRCzylJAfJO +X5qDBwjA51KFElHaGMBxEndBbmoo5mbRt1tExXGrmotJaWWzN4/u9jUF7iyX4578 +9S96QanGEbSKAU8BavOC38wB6T5/kFnCs9S0QLybB/lfWlgeSZWlbJfTmjjvlbRe +cMJpeTwpuwrl8+gzeMISZ41iEIJR23o2XBXtkYT0879EpcFVnliX5WTW2+pAX2uW +7Iro1gY4uHoWfFOLV3D/d85QZ2HaN7jVjv+H9VAZfpmPMJXgBV/ZXeIuv0dNPw0i +fJLIOWCb9TxhXMpC9TwE4oopvScrhzjszEyOSHINha+HdwT1R+e8U6TD4izUOgVA +oExLvwiVUanj1d4a+tTUs7wkIXhglRhmoEh0jhK3wtlwLm/7ve4EWLqXXTEPUcrV +A6h6KF3D/MwI5ZrbI9RbeqX7xL/0DsYzsW4wtPZFcH5xwXfYZ1U+kCN+jwjfAZfI +43mb3+O+w3VjGIBsIVUgfhBmD3sbai4IGyJ80ooIL1ZRvgxaIkc= +=e00T +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/DeprecatedException.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +9e7376f0ebae86996a18199c0f5ebc3416d20c69c791d3747326a0345a75f2cb165798bbb5eef3308844ca45cb6d60c174c62b571a16d08cef58fb4197db6144 ./x64-windows-static/include/pulsar/DeprecatedException.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,86 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef ENCRYPTIONKEYINFO_H_ +#define ENCRYPTIONKEYINFO_H_ + +#include <pulsar/defines.h> + +#include <iostream> +#include <map> +#include <memory> + +namespace pulsar { + +class EncryptionKeyInfoImpl; +class PulsarWrapper; + +typedef std::shared_ptr<EncryptionKeyInfoImpl> EncryptionKeyInfoImplPtr; + +class PULSAR_PUBLIC EncryptionKeyInfo { + /* + * This object contains the encryption key and corresponding metadata which contains + * additional information about the key such as version, timestammp + */ + + public: + typedef std::map<std::string, std::string> StringMap; + + EncryptionKeyInfo(); + + /** + * EncryptionKeyInfo contains the encryption key and corresponding metadata which contains additional + * information about the key, such as version and timestamp. + */ + EncryptionKeyInfo(std::string key, StringMap& metadata); + + /** + * @return the key of the message + */ + std::string& getKey(); + + /** + * Set the key of the message for routing policy + * + * @param Key the key of the message for routing policy + */ + void setKey(std::string key); + + /** + * @return the metadata information + */ + StringMap& getMetadata(void); + + /** + * Set metadata information + * + * @param Metadata the information of metadata + */ + void setMetadata(StringMap& metadata); + + private: + explicit EncryptionKeyInfo(EncryptionKeyInfoImplPtr); + + EncryptionKeyInfoImplPtr impl_; + + friend class PulsarWrapper; +}; + +} /* namespace pulsar */ + +#endif /* ENCRYPTIONKEYINFO_H_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZcACgkQT0AbyNP5 ++1Uz6RAAkfAq9sEFgz67us/ZBccWgZn4n3Wk2MIt/bX/fFzPvB9pwUxQ7SqTBLIV +NEUGJirF1I+zNultr3LCvWj6F8WxbGaUlIR5Kra9WPTCPzSsvwHtzUjOH5ZLYuCZ +MX7Edxvb0L8qyIRXcADIczgU2F+eagwO39XAdEO2NkM6fnX2XxbjZzknBs9mY5+Q +4EwS7yOhX//x5PjtfAEuV6L2pw45eyo790/jps+OEgQENLB3RwLUfPKIgPsiFMPj +aOObxIQO5hgzShvQPqB3spxTzjpY9JNQskCY/S+IGcEcx0U9V5NLIl6K169GQLHg +WVmoHTr5PHzSEi9BVCpUEhYTYDH1nhkwJAb57S5GBHjIC83vRy3A7tfHX/+JeRv9 +9Ir2IQRSuuAwaktBth3VXeNtXDYdkq1RuwupfO2OmegjR/O0DudamEKYzScuDFsl +Db5aeAQOqprTCekLVqxF8Dn5V26zB3mDpL4LPYnUs3v43osEp8OL+LCbxN9PYThE +xplPEn6y5jdawunT9fZIvuGmdiq9Ht4SAOX0gyxeesc+Z0o6OvAe2ssX+FeDi4rf +pRZDxEqqP/wRy+oliKoVXPB5EnGpb2lkssoJ4we+2bFRNuzO18N5nq9bj7hMQg2x +v7hVEKhBEqHMJnL/WP8XQcPHJkFpzg1u8ppVlRF1u5xdXFN8yjc= +=N6X8 +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/EncryptionKeyInfo.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +663efbe36a219638efe2cf8298191112cd84c5c83fdd4f46fae907015dc764953c4dfbd3019df246558c5e666c750f223516eccc0eb90b7152da74e4494b3547 ./x64-windows-static/include/pulsar/EncryptionKeyInfo.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,65 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include <pulsar/Logger.h> + +namespace pulsar { + +class FileLoggerFactoryImpl; + +/** + * A logger factory that is appending logs to a single file. + * + * The log format is "yyyy-MM-dd HH:mm:ss,SSS Z <level> <thread-id> <file>:<line> | <msg>", like + * + * ``` + * 2021-03-24 17:35:46,571 +0800 INFO [0x10a951e00] ConnectionPool:85 | Created connection for ... + * ``` + * + * Example: + * + * ```c++ + * #include <pulsar/FileLoggerFactory.h> + * + * ClientConfiguration conf; + * conf.setLogger(new FileLoggerFactory(Logger::LEVEL_DEBUG, "pulsar-client-cpp.log")); + * Client client("pulsar://localhost:6650", conf); + * ``` + */ +class PULSAR_PUBLIC FileLoggerFactory : public pulsar::LoggerFactory { + public: + /** + * Create a FileLoggerFactory instance. + * + * @param level the log level + * @param logFilePath the log file's path + */ + FileLoggerFactory(Logger::Level level, const std::string& logFilePath); + + ~FileLoggerFactory(); + + pulsar::Logger* getLogger(const std::string& filename) override; + + private: + std::unique_ptr<FileLoggerFactoryImpl> impl_; +}; + +} // namespace pulsar Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZoACgkQT0AbyNP5 ++1XpuA/8DSnk/HL78OuPPFGwSKldWrC6T21u4MQlHbSK1hIvf4CbvmxyfM00W6DH +oRczJzUGfb9ndk+yFMVKrBGBXnZHRCGj2HcszbWjcEV/Q/6wPyrpzqcBjpp8Tx7I +qXTj7gAeZvhprsHgtHVUdQPPOMOKqHGYDO3F3GB8Di1n/X4FCC0Ge4WW4Xte4Ceg +sGi+YnnVLSOYTpmUv9atY9rk8EynqovVQ1EpWHKfpD2J9FEQ2wMVEqOhCjIg5qH4 +tyF79/WgStZfIND+NAyBisEQbIICVmPtvVtiVjriiddLYaDnDJ20t7eBVC4R1MFY +dJ/BJCIoS7cwrdAyud8/k/TB+0Q5Psit2r0eEqRUHqRIwn0btTtVhnbUgjc0NMnV +lw/lmauTP8vbq8cuwY9DdxvuUXYKrJk1MLJvUMaRGPPUhCYYPNTOjE2RARmdGi9k +njEzjIwxYAeUQ28LgI3pwLHVr+9knkpKka/Ghxad5/rBPdYWimhu0EBgLV6MTYlN +2Z5YBPxUVh1aMaJIlOba/aN1/+K0rgPivY+K1+zPdrZSmE6QD2bl3W2F/Bd2SYNW ++u+OOaPQ2CjxkKngdu2oVV7uIQKX6Lz4mLeJz/LBiau/19odteaAm61jTulaqFYe +3vkxgeotSHo6uAYj/6rf4zUvUgg8o9N5yr7xXSBpMQOIXWPrGbk= +=rH+w +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/FileLoggerFactory.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +ec811f9c074400497b8a8bdf93b9f20519852671dd2993ad89ceed500881e8ffe9e8f3eb266e31640fb559d87e922b525dfa00a5f5197fe373bc4ae22d6c1248 ./x64-windows-static/include/pulsar/FileLoggerFactory.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef PULSAR_CPP_INITIAL_POSITION_H +#define PULSAR_CPP_INITIAL_POSITION_H + +namespace pulsar { +enum InitialPosition +{ + InitialPositionLatest, + InitialPositionEarliest +}; +} + +#endif // PULSAR_CPP_INITIAL_POSITION_H Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZoACgkQT0AbyNP5 ++1UQ5Q/+I3E1JNi1Ceqo7ok15mN4Sngk6NXpzNem/SE+rQPFNVP1hetJCYwt+DWP +SuOmfoJBucZe4WspG+RYeAYfmQQHK2kvbaPDYs9dlRQ5yUxx0pNFDeCSY56VDuJf +53fwov3tHZV0+kd56Yw8hfRCu/y6w0KOwiW1M/9tRyfjCzyorSL/tLmew6WynoaS +eLreZfz4QMdLJuIx2IW4c0t0NsiW1X9mqz4NhY6s93WvskEK96aTERuaQmRP/IM8 +vBnzVNeBncONR7p7A0qinjVqfMJygZwJ28J0q+7NVuK9l6Inbk6nS2xGZmeMGRiC +U5+d4LwcmrTBkl0bU+ilqOOvEoAZcn7+s+CmhOOckI5X5fpg6yt6qgW7DE1Lukfm +Rr98F4sJAI/s+HfS6iMPpaTvjnFaYdwq9awbPvWc915XcJXkCQIIKmvg8KRR7IVz +PkEAQcB99Jya3UkfXsRsogstclHSKWJsNYINOqt0K/z4ZW20VyEvL1iN0lJDuFLR +LzHPbvwLKquHBVT/v6KDzyLkveYeZQQ/6ub3bneSFJsNV4jEdyBjeHZsENmud0ys +5IcE/NsMPImQ+U6FPxjsBnyUkVfyLJYyAj5aDxTZ8iBJxGgZhluEgADB5x7z/O2P +Z0Yfl+Kr5pOauwJ0FwvSrPW19xUrOs/67tgqt7TeDXkV2ihrcXc= +=56gs +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/InitialPosition.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +6c705006ca2368cfc564b917b55e2d4e89d3bd5031fdf11f7812dcefec1601827b8c81a1d14972660623438c4b008b11b4b04491283bbee5c90fc3d84c6205c9 ./x64-windows-static/include/pulsar/InitialPosition.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,109 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#pragma once + +#include <pulsar/defines.h> + +#include <memory> +#include <utility> +#include <vector> + +namespace pulsar { + +/** + * KeyShared mode of KeyShared subscription. + */ +enum KeySharedMode +{ + + /** + * Auto split while new consumer connected. + */ + AUTO_SPLIT = 0, + + /** + * New consumer with fixed hash range to attach the topic, if new consumer use conflict hash range with + * exits consumers, new consumer will be rejected. + */ + STICKY = 1 +}; + +struct KeySharedPolicyImpl; + +typedef std::pair<int, int> StickyRange; +typedef std::vector<StickyRange> StickyRanges; + +class PULSAR_PUBLIC KeySharedPolicy { + public: + KeySharedPolicy(); + ~KeySharedPolicy(); + + KeySharedPolicy(const KeySharedPolicy&); + KeySharedPolicy& operator=(const KeySharedPolicy&); + + /** + * Create a new instance of KeySharedPolicy with the same + * initial settings as the current one. + */ + KeySharedPolicy clone() const; + + /** + * Configure the KeyShared mode of KeyShared subscription + * + * @param KeyShared mode + * @see {@link #KeySharedMode} + */ + KeySharedPolicy& setKeySharedMode(KeySharedMode keySharedMode); + + /** + * @return the KeySharedMode of KeyShared subscription + */ + KeySharedMode getKeySharedMode() const; + + /** + * If it is enabled, it relaxes the ordering requirement and allows the broker to send out-of-order + * messages in case of failures. This makes it faster for new consumers to join without being stalled by + * an existing slow consumer. + * + * In this case, a single consumer still receives all keys, but they may come in different orders. + * + * @param allowOutOfOrderDelivery + * whether to allow for out of order delivery + */ + KeySharedPolicy& setAllowOutOfOrderDelivery(bool allowOutOfOrderDelivery); + + /** + * @return true if out of order delivery is enabled + */ + bool isAllowOutOfOrderDelivery() const; + + /** + * @param ranges used with sticky mode + */ + KeySharedPolicy& setStickyRanges(std::initializer_list<StickyRange> ranges); + + /** + * @return ranges used with sticky mode + */ + StickyRanges getStickyRanges() const; + + private: + std::shared_ptr<KeySharedPolicyImpl> impl_; +}; +} // namespace pulsar Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xaAACgkQT0AbyNP5 ++1VvLhAAhumDw1bH7PYWvX7LDlWXzK4cp/W4SA5S4bLGajt8qcf8bsWZwfvCYvYf +nOWQR5Wg7u5xrVx1PGUamG+2zPw92QuTU51JFspucIYvn+B/bED7JADzlJcZtQXs +tvuz8Mw8jdbrzcN3eEODLLslDR558FwF/NB9TfwofLO+qvpiIkaXbRFPb+1itkNW +t8TSrjAPTiBsupEnFWFVc+80cz16MXDAICK+vB4ktW4n0R0IVU4454V+XwzBxwEq +DQKt7MQK4ErwCE8KdUOvbPSxYOlFzcMMXC88kxgGR2rvSnyeQWz1BM5XW/yopaHL +sq6fDylOS5QZAnyGH9wMZov0hUgH1XjDwjLA0+BF2Ojk0wA8szc3sSRppeF7ayYu +4PZHzlFTHr6pf/mlbIktNkQqLtsZhy8GqAVaKc5tOG42gJbIejnQH3MRzuBhVEiX +SRXZ1Jpv2i9Bn6Sbrq/F5ydrKkO7FtweCPtWlWOYizJc5bgE/qQrrwPOCsp7Nd3J +Y6zozhe62jHyHgs7MvGYXrwTj7fORzDVdIcM2o16gpxtVchUEQ+96OWtxxmdn4vu +pDimCV6vt119NyG6jhFTWM9HUU5tJ4UYfXk5G6bhIWGMOHN8doWsjqm5bLN13hv3 +PGmzidtaFIUuJDLnlI0BtXj9BX6ds6+5qJFJz/RVVlCMgFRj80c= +=kFyZ +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/KeySharedPolicy.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +fafe096a436afc45f0fd5b25abf1f59aa1a55b6c9b7dbefc2666f1e156d0839c902661f8b301a49e0be3b2153aeb20fa9c803f3c15d1eb2650983ef6d1ef3ce1 ./x64-windows-static/include/pulsar/KeySharedPolicy.h
