Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,61 @@ +/** + * 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 ConsoleLoggerFactoryImpl; + +/** + * The default LoggerFactory of Client if `USE_LOG4CXX` macro was not defined during compilation. + * + * + * 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 ... + * ``` + * + * It uses `std::cout` to prints logs to standard output. You can use this factory class to change your log + * level simply. + * + * ```c++ + * #include <pulsar/ConsoleLoggerFactory.h> + * + * ClientConfiguration conf; + * conf.setLogger(new ConsoleLoggerFactory(Logger::LEVEL_DEBUG)); + * Client client("pulsar://localhost:6650", conf); + * ``` + */ +class PULSAR_PUBLIC ConsoleLoggerFactory : public LoggerFactory { + public: + explicit ConsoleLoggerFactory(Logger::Level level = Logger::LEVEL_INFO); + + ~ConsoleLoggerFactory(); + + Logger* getLogger(const std::string& fileName) override; + + private: + std::unique_ptr<ConsoleLoggerFactoryImpl> impl_; +}; + +} // namespace pulsar
Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYkACgkQT0AbyNP5 ++1UkoA//Zl24hypyFMXG8rJzGfI0HOTDn5zm0ePhHCr8BoBLppGFHnqZ6vE8bS2x +wPd5EnvbSmIC/08nEuyFsNOr9nQiGhmDfoHeE0PeiW5/M5WRPgn7HA/qvRe2ig6R +7CIPJvFutlmTw64VQsF89aoYERUX+AyI/GjXz+NeC2bVz9/626+dxeP54sEMt1Ny +YQ0E8s4h+fh2Ky2soliY7thTaI0d/jMPm9e5bV8BZTDRCKGOhuW2gPdHfW4Nft1H +cgWRku8Gb/gARAjEhdWvCrupl/hQenkYb/e6dnX08PuoQZtuWXzyvBRPrVJUF4/n +6M2NzwXbGAaE0qRnGez3D6WtHnjyPcxU5FnOTURJxxRyq6IOLJysJei1/MPHQhel +8A0CHL44n13wax1JIr/Af9mn8HDnp+EjXs636eQb3LyDr8mLsHW7o4igDsjyElBU +Gi3vUoB/cI7N31yX5Uq3ZiGfle/pSNhokTpbf+cidPBagIpdEtga1cnbBW3QiDDC +JnjQPEf7yqaCmZoXxpn6c8s0q/IgLbJSWtl5aYU9aS8suwtIEVQfvgvCVDrXuda8 +sVuVbM6CLvu+9ftpP1n8pCyGl24T1nMFu7cWfA295VeUxDa0Dp74rezgFWPf/uZa +SRQGZvAUxkoL7OPma+h1zaO7zyyBb8VM3DHN/PcjsIZL2tU6gL0= +=UP1p +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsoleLoggerFactory.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +55368be472b0d636d7a9e136e0272018cd151751ab65f299056d85645afb0ed22dac2995c1d1c82c4793093dc1bdf53b1131f59acc6353b9233f1a3d4f8e1f7e ./x86-windows-static/include/pulsar/ConsoleLoggerFactory.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/Consumer.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYwACgkQT0AbyNP5 ++1WhVBAAq6za5lAYENk22gDYWFwFeErtomj1yUFpd72nm5IePHyxCoTv2HkkHVM4 +hcL1dz+seVrX3udbK8IP4aErdyFr1Y9VzxtTacn++6C3wDQSsxOjVOfop1/zBWHq +NZjpwVkDD2CvXa/zkwWZf4SZS3yoZDz7TSuxfnvnsFvyrN1PCwPcFSYn5w4UMg1H +YGYK0owFSwUll3BS43mGtX86Yi+1UxiNG8RQLbbWqC9Z5VyV8coBanQ3W0+/BfiT +WwzuLK7feoug+qF8R+UVvZYn3u6zPAQGCWEBjM7wTeXPEnSlncXAmwTrNLBL1hLL +wVPZhVYu3quMTh8qBkgsPw9Ib28xeOOIu20DFZDnffSLMfxvIPiinWFVcECUg/aZ +BcdtBGk+AdEMWsFMaz8qF+rrF3+pcgJEcPLrFFt3JxLfQO8fxUwnLLFaUgkMnUPB +BB00L5gPNvhPCRdBMtxemYhuBiOhCmyLtCjqFUKHft7B9Yk4RKrYdCRmyfHxTWu6 +ncxIUv0AgLT69mYsn4v5CS3YcYXUwiTZwDkmMUH5S4nOxcYIVC28tM3OoNcMSAY+ +ifIeaJTrvhzF42ygJdLf6VxoRYpIuwe+DZF8r7DtJ6eFo1psrtONHGC+3gSaFEik +TE6dd886CqzwsSH717r2kh2oOOGdxhI2xwVEJFEnGOa42sl78yg= +=K64Z +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/Consumer.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +0779b4d0473e694e53b184c6bc1f66901d10ebd48feec2bda85263a994ca4bf801fc98874378ab48778951c59a172733b038189ec2faf54bc4e67e0581e15cdb ./x86-windows-static/include/pulsar/Consumer.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/ConsumerConfiguration.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xY0ACgkQT0AbyNP5 ++1WQbg//T3ZbDz/2p/dADqQX9zEk+NTwHoAvAiK18UWTCTPyG7r8JrX0FBzXZB3c +MQsQULawRbjo02dpG+iNc4OnCwDkE9n0ZaO/a32Bc/NAPE3ArxnlYk7QqxAkhWXx +BbrRR6zKyk2XKNBMBDFslocX6zr8eN+AryHa5gTSsy4vKyKyS4pJUa1/kUTp9Yyh +9odXDMYDzp+KWOAgAz5HLRX7lhHJnNhV44AGlld+TDOhWPcDIpS3gENV0+dwewfy ++XSn/lKIhZ9L2uzKoCsEbhI0XghA2wfvhmIJulA8suwLqXaHI5eTLBNyKIwcZrS4 +OzpGLgZ3sXAuG2LPJ54+Kt/K9HEc/bAgsOJWXTmcrvKjb6A5CgT5MDgmmQw5qMp6 +r1k1wW1uQkTlQBxw81AdGPSOhKZEKmQTZXSXR8QDdj8zxl8r5DiSafzqmoS953uZ +yfmZyNFG9QMJgalCqD1V/Me1+pCdkAGQsCrGWzL84ylcdpgMyV9AC6Nsb2xGieEA +DGhm9iWw6uvK+lWGZWhas+VeFMlzn8YhE2nxDC4+sJF35V91Jwa4WglOd5+KVkH/ ++1RzNMDCLdtZVfGzZPZiSjIff8+1ni0DzI4g3SinLR/pNcZCryIpJsQj8kMP8VjK +jl5PU/txl8FWKWGrvqflTDqD9Zr4Fhi21XC+AaruE+vL6FUaJ+Q= +=c4I9 +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerConfiguration.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +405f33099de51b46c25f543b518e2889a197e3674567b6d0c0c545a10a3a49c38217e1cb1d17c73322acfb457a7baa8c699a485e52ef2aa9adc6d51ceddc5480 ./x86-windows-static/include/pulsar/ConsumerConfiguration.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYkACgkQT0AbyNP5 ++1VZGRAAhJ9Gbf9SQkGwWeQIq70oZ6gMMv9c1GmCXmMqssyNos6aWHWPF2koYt5G +L2GaVwlxDkEjBhnUCBh6PQ4raKBtWW4gTWsod1j2M+T14GHgZsXz8V/RlH/bdC4e +Lg2G1p41HuAEWAAwKPmlOkLr5S2eWZr7oKiKev02WWPOjgLRMuKjRgpgFSQpCO7I +kDYN70nc9V9K2WQpSdfnRLcnGtrHToruWWKqSCoU8Jrxq/aB2jEA+8lMA4nXX4MA +CwbikefP8alUYZEkwf5ygRWacUo3hkHedFQRABa6GEdmwn2xGKc55zQdCx+2/vKA +5NS1awngB40Ivs5oG3QA55OZHnyc0JPHEVJNZDvynT1Wf4q+64tYxwjUlNl/L6vh +vcMXapakbNBP+6oZ5+6xFgKYlZNWeT5Kq3D4i565zDCiqK5L9CHbg0S+0qRUlk2A +YwGk+POBHxtsESVj8hgE/9AmEUckEo7gzOwAVDklv5qQhTNSy4m4QkfPXoFzWHWh +tgxDt54Tm/pe+EAq59538ScowAwDvP43KMPj9JKjHDHBhvAr91LuYDrgrIWd4jF+ +EkMk8hk4TtIpeVs8Jl0iNiHXHGzOLvvuiTWyV7WjiZktictVJWgogXTndBpzJj1f +sQr43KgXtVqAE2GDqRiz+svte2VpxD4M+uJcLjtTMJ25j7oAxZg= +=THtP +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +c8f532cc7d2e88c606e1b5c2389a49f87a3ee8db5f9d489a230830be2d55beb703159319f8e85376eba238d6a0251751421d19e31219a00a7dcf0bdcdea10bba ./x86-windows-static/include/pulsar/ConsumerCryptoFailureAction.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/ConsumerEventListener.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYoACgkQT0AbyNP5 ++1WMJA/+J5CYnV2efvB/dPkdKCfIkiGSa5BCJrSOygqK248c+gCB72plt+wc+r8R +qmCbmb4OAOGsralw1M//BhGIsIXxVdXYJq4KRVDUtUhv5xco4iWgkY4c2+barWp+ +etaEJYuAVVDx/re2mbJWqRDo9QQ09hyDM9zBZsUn666Ib17tGGyBEwy/7xxJgN+U +C9G99FAhbC3LTnfAKc5D6eE+7W869ojj5MwZHjYT9SRahk5Qo0V2771q5gi1EnfN +FPWpKdFGROpaPq9VRw9dbjoHs7rfI7CswY7AyUfrSWSeu8jFADDJYNnEyuAq+X6M +3Eq8sP15LxL6KP1p/YRHCrGyDwqgWRK4zGuq7iC09P+9nV4gbcv0yfoNg7zEK2Th +wj7f+NkD3GA2yoQ82jp7TxEfUXeEp44U/KjBxjkpb7qas9jgvPaeSSZ2YZR9x7k/ +IBZfNTa2JJAiM9Wti9LLTT+GVXy+gX/yeHvxuPJgplNB9mEhEPNC56j3pRpNuSDD +U/CVgrmJgMZ93r1WwbxlYw5/LbRhMXqKxnR0kqnyLGTLXsXDz+tv4EqSCniS3TX4 +fJh/c+nOES2f0Ma4BuFjxb/+FAh5P6mYD1EExAlCqyiUR2dL5MvoprGrsdiH+E+W +S2uE9Oe31Ib7do0bUU4LX2WIPUy0PcBxuTClLh8aYBPnE734tVE= +=waMW +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerEventListener.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +d6efec4e607f673e20a5f47f123c298af483699f94de6c4550370584d4ff25234b1939e4ea5beb0defc76ca33eaec3aa545c09595c7b5a79579fd2a2a7d3fd0d ./x86-windows-static/include/pulsar/ConsumerEventListener.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/ConsumerType.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYsACgkQT0AbyNP5 ++1W8xw/+JK8fbTbs6M9mxDAvlTEuK+ZB2Qf6srPx6116aKi5Teg6IRhhH0YzyHbO +wKKrN8sR4S7PbmyuuhWWaNEgkzKO33myqpeJ5Q0zZe083sxDpI3U1CpZGA8MKxFf +QtAXqtDJ5fWRo5/0SizTvIx5WKuBiRz/M53sfylEi5F4O5+UYiBPDUVQHsA1fNaP +jOmjruLZt2HEUOeaJqrnQ+aoObJxPM11VAuIGFwZ2qoMhhQnCYbrULiXUg3z4sB+ +Kp00o2dzqzdhJhzvzJqOjbGZmsJG6QzJedeW2myWEFFs/PMv6CxnYxo0CMnZDy2t +sD9DAoxlEGXFjYSgVsF396BGj7Zoeu+uqjSqtDCkjxm5uMApOWIVACzzz/zHy/3t +rmqjM69IsnHWfxWLuKIhaASAM1SmzOFr4Z6Al/VKRLQymNqM9Q50lsu97QgQqvpY +AbPV4FsWwOOGPZIFbKcS/yi/hnSkLQ5nuB+mbGVPAu5MtK4yFIFfO+Odgbm+pODM +j6aNHa7e2P5SSW56OEJAQzOfLgxSvfGjOcS9V1l5XaVvmfZX0DUXlaIBPfX71Kko +MUh8hm3m13p1D0WRXplrxl4QWse/ANBltKn6obWInXz0TkraifekgZIUkPIjBVST +VSYtyniHxwGdT8mAF226m3X6Q5rhJfVPPTaFqqcKq1W/jacztKo= +=yAbo +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/ConsumerType.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +bc92ef22da64c22a2e385d2beb085129a6b78255a3222525030841b70dfd2d85c02acb87b510137e91225e64b5eb5407fe2c0c9d998a3e5b685b84011ea596c8 ./x86-windows-static/include/pulsar/ConsumerType.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/CryptoKeyReader.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYwACgkQT0AbyNP5 ++1XQTQ//XYO56fw1wU2sVg3eljeSNusANv6wW4T18fy1S9+6aCgJDIUrV1+79d+t +Kz9jAJYBlmh+0GtZT2WelmhOVNB6UnhZr3s0tKg8xqCxKPZHXwjXivUzX/uJxwxh +m703JTOsYHPx9Q9WojNitsJAlq8mT3DRp464DS+4+i6arSO3VTxFIHatQDTRHovo +dWVr8GaoTNfrAnysGZC0/xV7fzTY5+gxgErJtbV3wmLe3BpDMQ08NFAXmgm0KSFx +sUucvF34lt01PJ+L6747gUGE6zhLhx4+6Q5mScSdfsLM+NrGiFE/+2KzVkANeVZv +aQLMBReTAbzIznOySK+iaTx3xwvBBqgDBFq0Leh3RRrmH/wIHSi+g200WlSZSkNJ +jiDcGnIqNQHyHWufczSJBK2l4QIyffKSpAB/sgksOWhf8tiyXB2RGJVYS5q/7fA1 +sJte8V4Euf49CprHvNQhFgSl8XBrWJqKAh2LLop3bkv8rsvGn4hl7SP42+FIJ8xv +a1i3Fl75Ry5nCF6k5dMEmxTsCVmc3i2WAlzkCoAUB7+afRvNXMQZx4MGBDoI7MsE +Mt2l4KCqB0dOXZR0QKq3CYGEgpjXK5mCMCr7udaDRsVqeiSN4Ukx90TmXxj/sWQm +OPV46ajgccGSlxJmtZ5+uU1kP9cscMr/6Cb3YHA7LHUzcwGCHuM= +=BW50 +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/CryptoKeyReader.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +44e13c8064218c736bc905a1745de3b68a5a4abe560da39b8487796619dd87705f0dc084eca5a292dbdfb5fd6a3e038ec92c641fcc21f75c67b8202f7be7aa71 ./x86-windows-static/include/pulsar/CryptoKeyReader.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/DeprecatedException.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYgACgkQT0AbyNP5 ++1UrvxAAj26QVn9Z7qMwdHBQdUbZz0RL2ZhsTSa+AHQraoxMtkynUMCt8ALG/sQt +ozaqAgD3vFpjN033RbheSrwxf+4/wSCOz58e8bfF1cvr01KtBsrN7C8vbIZiJaoa +rlXs0OBKmDt82QQjJ+s9wIQCbYouQ7ahVfKuwjEAQiU2Z2vLtOe3VgbYFpCzE3E2 +DTehnIiQFaQ/gUQx68XgFu3p59ZwEnVG+z6DEgphLVFapeVPuroyxwyNqkifXLuG +bcEdCiwfJZOcLm1I3WpnZcxc22qZSZfJjpMV8tG0s+7CYZIgtiMFSoa64QJfOH75 +Egya1++cphDRPbEOSLB5QXQ4w8jeQ+uFV0Zx4sROMu54JiVMx7IFtVyq14g9BOb4 +roMMiCzQlFoPJQKk0oRmyeofwv4Dku/54RJTtHTqfnujyokwFZtrNSHr64oYwBug +JDR2NJQI0wZdp/CIe+bF7ouOpEMCWu024eWDAhQpPzQ7+mcKI494tG3Ff6EHfEoT +FJ0g7cJYWN6bDGR+Ux1vF2N40/nP9xgyCTiPfJXETXCZQBFFOD+nMgkYhb35lNW1 +PGlRJUeqAoRHtOPapcpL6S8B/cSqPBsAjvlV4MOeadlaUYjLTGEiTDnNS0RVPTuY +kGFV9xJnMHpfoFOC+P6qSUu6C1ktIWJdby/pnSo1meB0HaIdnYs= +=3LM9 +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/DeprecatedException.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +9e7376f0ebae86996a18199c0f5ebc3416d20c69c791d3747326a0345a75f2cb165798bbb5eef3308844ca45cb6d60c174c62b571a16d08cef58fb4197db6144 ./x86-windows-static/include/pulsar/DeprecatedException.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/EncryptionKeyInfo.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xYsACgkQT0AbyNP5 ++1UVrQ/9H1zXBnNA9dPucHbgjLDbk7E8t2V7KQm2XGDzhsxtmuYPaUmryYMg2FSj +UuvpRS412g8gkbxbaJ8ANMPhKv+f/q1Y3tb5Wnmx/XXt1rui6XEW89yJcqXssfUS +iQkgynkcVXJbPoMlNt0R4K/OyZQNR8yfsyPXH9pJCCdCztAY5ETwrMHxFghdC97U +E2XCWVnOkBrZ0vori/Dzsq9CXAoXWA/aXvIsEtSVTB/sJBjhYPKfhRBlM9Wm0ENJ +c2yL2LnPbiaQ32fFsv8nNpVZm2LAcT1y0hZYEnKYLOqI/nwPEF5NXEcNCgQoBAZz +FwvHFdgyRfAbYHxc4eIhTaGgAV3OTrRxccm/NpZ3i9r9gZb+d4/bKoVArlZ0iX2W +eJaQFZC3vqhsbYp+qzNnx+vv+n9R0F6GfjuPtdwMKA0vZEpODJNkAjIXtdSqXIPf +sSp0JDnRgdipnfPZApxALbhcO8KK0rGMOiR/hxVeLJ686XjANn+JjE9i8IFhMLHP +HZowJAvlOHzo411v2eYPfsAG4Wosd6VUNGm1vdzF1+WFCTpcE7xi5hT0C/kVscpS +22X9+HYAG21MaeZUwmT7oa/Cv3+LfLwxOASd9aFBL8TPZlbGnzgtUlA3HqDX23PY +oH6gFkHdxy0jLUYvf20Kr9ncRRgzqzV/Rm6YU0Y5CtyjPeI8mAc= +=Fh/l +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/EncryptionKeyInfo.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +663efbe36a219638efe2cf8298191112cd84c5c83fdd4f46fae907015dc764953c4dfbd3019df246558c5e666c750f223516eccc0eb90b7152da74e4494b3547 ./x86-windows-static/include/pulsar/EncryptionKeyInfo.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/FileLoggerFactory.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xY0ACgkQT0AbyNP5 ++1VPyQ//aMzs+yW9K3iz10fPYyzrdbh2b45+klogTTGtv9qDuKLG+3CSZA0aN/zJ +UemB7ONbX3B42VoFPVx1PjPOlHQAruXBMOGYfIGjkqRyv2H26mDtMBzZXIssGlT1 +rVimWEIBsmXrDEmS0xowGt+k2oLDct3mny6I+Ja0xqkSD7yiKY4j7r2Wzl5veJkE +kqTqNIH5Kf4sYDfvH+ZaG4mTbqngKErAGvLS20Yx6UI504Ve9iVqSEVZbPL18Qz5 +7uuvpHfmYunHbEUOfsp665Bvtv4evtIBihMkdgNXyxR95KtW6jdSBtoK30a/gaO+ +s4NykPar1RfaDn4YtmNZ/sCKktbuD1iT0O85rtYXA/M6Q/irVrEQEei5ZavQqkkl +tsooTNckEuXFuajzYBb56kb4XLkY5h6vvO0k5KRUv6yTvJvxUT2UNGn1vDDEla+1 +KZL+d2fKGbzm0an+/D9Lwii847X51B+4/D1zqRQ4j6xPbit0QivqET8boSFBlt2x +yhobiVIZSAzNHykAqgoChF+iqb8DZQmyPGqXB1A1Nx9xUtUTOTVXBiK1cKZB9mK4 +Jr+wJQWNIudyrc8WCFqK1NMYevvIVh83UOoAY7jUGDy1kd8YcqRrWixl2S7st+iX +VlDajawbamnHx1uc0oKDJo59x++lK2sY4qyAd8w9P2Wrm++/lro= +=UBhW +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/FileLoggerFactory.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +ec811f9c074400497b8a8bdf93b9f20519852671dd2993ad89ceed500881e8ffe9e8f3eb266e31640fb559d87e922b525dfa00a5f5197fe373bc4ae22d6c1248 ./x86-windows-static/include/pulsar/FileLoggerFactory.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-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/x86-windows-static/include/pulsar/InitialPosition.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xY0ACgkQT0AbyNP5 ++1WOLw/+NeJHx+c/dCpRRwWOk4QgPL3Ljnt1XYTpznPS8tDEC5Jja1oDrI0915Fz +Q1fvi7Bv6vgbKdwLylSXODMXTy6TGYbWHRG7mmeLYDPWTeKtLcWSXxouhKiGJ5RK +rtomxSLLkMSSvO0+aP8QIDnItt5Css1UInEPl0QXotMxsiFdf/5tGEM3Z8Xk68Lm +nljuN/gLS3mCkw1KvLn4vQs+RxlMPT8O3iyfS+hgin8/A5MaTotLJ0IufBivQuin +jQobc1fSt4v21GBV/OIlHzlWG58pXPHiANiRzwcuCBUJ2HsneGdEFtQpWBe4XWGZ +hLsvNqpXFbVNdYBsHTr3x7273Rz9uyhD9Fp4zk8MijqRdeTivaQIdAAgkZw0k1cn +EfBfwXSzG5htVj5rj2J1S8HP6z4pZej9OPQPzF9EU2L3g5HvAGDvCPZInSVFnFTL +Nu45v14fgJAS2+6FG5df3KXiRlNZuh44mtfRGZI5p2Tkz+a4D6iJ3SW6WvlVtg3Q +EjsSbt93GkeLkKwcglMfmGUoQ20ztbnBu6g5PdAh9Udg2ScuLvpBbJMX+BX16Qm2 +t0oeJW9r86XvYt+u4nrpXFVKTdw1kjI2bm7SM3NipDFIGlQQSsVHU7O+IxnEx07o +SbJi32n0KtR22juvNcr6m1RRDxurNODTI2mTNRY4XxRh8rR0BjY= +=lcmV +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x86-windows-static/include/pulsar/InitialPosition.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +6c705006ca2368cfc564b917b55e2d4e89d3bd5031fdf11f7812dcefec1601827b8c81a1d14972660623438c4b008b11b4b04491283bbee5c90fc3d84c6205c9 ./x86-windows-static/include/pulsar/InitialPosition.h
