Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,163 @@ +/** + * 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_READER_HPP_ +#define PULSAR_READER_HPP_ + +#include <pulsar/Message.h> +#include <pulsar/ReaderConfiguration.h> +#include <pulsar/defines.h> + +namespace pulsar { +class PulsarWrapper; +class PulsarFriend; +class ReaderImpl; + +typedef std::function<void(Result result, bool hasMessageAvailable)> HasMessageAvailableCallback; + +/** + * A Reader can be used to scan through all the messages currently available in a topic. + */ +class PULSAR_PUBLIC Reader { + public: + /** + * Construct an uninitialized reader object + */ + Reader(); + + /** + * @return the topic this reader is reading from + */ + const std::string& getTopic() const; + + /** + * Read 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 readNext(Message& msg); + + /** + * Read a single message + * + * @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 readNext(Message& msg, int timeoutMs); + + /** + * Close the reader and stop the broker to push more messages + * + * @return ResultOk if the reader is closed successfully + */ + Result close(); + + /** + * Asynchronously close the reader and stop the broker to push more messages + * + * @param callback the callback that is triggered when the reader is closed + */ + void closeAsync(ResultCallback callback); + + /** + * Asynchronously check if there is any message available to read from the current position. + */ + void hasMessageAvailableAsync(HasMessageAvailableCallback callback); + + /** + * Check if there is any message available to read from the current position. + */ + Result hasMessageAvailable(bool& hasMessageAvailable); + + /** + * Reset the this reader 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& msgId); + + /** + * Reset this reader to a specific message publish time. + * + * @param timestamp + * the message publish time where to reposition the subscription + */ + Result seek(uint64_t timestamp); + + /** + * Asynchronously reset this reader 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 + */ + void seekAsync(const MessageId& msgId, ResultCallback callback); + + /** + * Asynchronously reset this reader to a specific message publish time. + * + * @param timestamp + * the message publish time where to reposition the subscription + */ + void seekAsync(uint64_t timestamp, ResultCallback callback); + + /** + * @return Whether the reader 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: + typedef std::shared_ptr<ReaderImpl> ReaderImplPtr; + ReaderImplPtr impl_; + explicit Reader(ReaderImplPtr); + + friend class PulsarFriend; + friend class PulsarWrapper; + friend class ReaderImpl; + friend class ReaderTest; +}; +} // namespace pulsar + +#endif /* PULSAR_READER_HPP_ */
Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZUACgkQT0AbyNP5 ++1XZMQ//UCh7gmURyQ4tUGiBqkA9j8qRu9nZ2w5q0sEvyYK6ezH4n78GWLBFih8Q +jLMIOIPwvUtqVupGIevCcVWZii7CRe0WnaAO9dhVycBHhVQ5HodiPbHd+UHo8JY/ +yXAfkkHWPPPmlntLcLWUgvh+2a2ASxKixxbkqVA8naWoQSB5XvziIMLGEeZSjjqf +f9U2xuxt5wmi/GrwMoF34njHhwLde/6LvgVcF6dSPtKlrW95YoflVaWD6MboWf0J +CfSsy3JgB7ayitc0MwQWmiRthN1PvaGg9bEU/7qqCTTWmJYndGdH1D1Id6fqHu5M +Zw/o4X+n2Gd0/8LpucFgyorxi5fHa0aClsnDD5T1M7w6Me0HzkVzmE2I/vHRm0tG +JmP2Y3/eTpbkrd+edPHss1o8rE8q3+Xxxy1gKGjJqqieFreFu+4wL+CzpyXYo1db +7++3dRAtMIRkAbncrvmDHttfMXA2fG2+vh738AWsgaarQD85Bf0FDVn5BBajadQ+ +Kjl1bxxaG3kqAjGJV2fEIvrfG6i4CXlA42xdov7A11Myhui96UnmRQXNQQe/8vzl +i/aOJUmhx/6GlmZKDXTIpPfPIhimSaLtywwnEslVMvGe7M6TRla1BKeo4UMiV7Jw +e2PWQILuubCLqRdhTQV/3BNgpMviZPmHUHSSRlz8aGsuWbICPdw= +=z6sK +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Reader.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +fcd0811d4ee6d41e7ac6100bedbbc7d86a53b3a4a405533b009c27b674f4537f59565bc7871f3f185dab8c8c746675ec175fcfa64bd3d4de624dbc4441ea6437 ./x64-windows-static/include/pulsar/Reader.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,303 @@ +/** + * 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_READER_CONFIGURATION_H_ +#define PULSAR_READER_CONFIGURATION_H_ + +#include <pulsar/ConsumerCryptoFailureAction.h> +#include <pulsar/CryptoKeyReader.h> +#include <pulsar/Message.h> +#include <pulsar/Result.h> +#include <pulsar/Schema.h> +#include <pulsar/defines.h> + +#include <functional> +#include <memory> + +namespace pulsar { + +class Reader; +class PulsarWrapper; + +/// Callback definition for non-data operation +typedef std::function<void(Result result)> ResultCallback; +typedef std::function<void(Result result, MessageId messageId)> GetLastMessageIdCallback; + +/// Callback definition for MessageListener +typedef std::function<void(Reader reader, const Message& msg)> ReaderListener; + +struct ReaderConfigurationImpl; + +/** + * Class specifying the configuration of a consumer. + */ +class PULSAR_PUBLIC ReaderConfiguration { + public: + ReaderConfiguration(); + ~ReaderConfiguration(); + ReaderConfiguration(const ReaderConfiguration&); + ReaderConfiguration& operator=(const ReaderConfiguration&); + + /** + * Declare the schema of the data that this reader will be accepting. + * + * The schema will be checked against the schema of the topic, and the + * reader creation will fail if it's not compatible. + * + * @param schemaInfo the schema definition object + */ + ReaderConfiguration& setSchema(const SchemaInfo& schemaInfo); + + /** + * @return the schema information declared for this consumer + */ + const SchemaInfo& getSchema() const; + + /** + * A message listener enables your application to configure how to process + * messages. A listener will be called in order for every message received. + */ + ReaderConfiguration& setReaderListener(ReaderListener listener); + + /** + * @return the configured {@link ReaderListener} for the reader + */ + ReaderListener getReaderListener() const; + + /** + * @return true if {@link ReaderListener} has been set + */ + bool hasReaderListener() const; + + /** + * Sets the size of the reader 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 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 reader name. + * + * @param readerName + */ + void setReaderName(const std::string& readerName); + + /** + * @return the reader name + */ + const std::string& getReaderName() const; + + /** + * Set the subscription role prefix. + * + * The default prefix is an empty string. + * + * @param subscriptionRolePrefix + */ + void setSubscriptionRolePrefix(const std::string& subscriptionRolePrefix); + + /** + * @return the subscription role prefix + */ + const std::string& getSubscriptionRolePrefix() 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); + + /** + * @return true if readCompacted is enabled + */ + bool isReadCompacted() const; + + /** + * Set the internal subscription name. + * + * @param internal subscriptionName + */ + void setInternalSubscriptionName(std::string internalSubscriptionName); + + /** + * @return the internal subscription name + */ + const std::string& getInternalSubscriptionName() 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. + * @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 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; + + /** + * @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 + */ + ReaderConfiguration& setCryptoKeyReader(CryptoKeyReaderPtr cryptoKeyReader); + + /** + * @return the ConsumerCryptoFailureAction + */ + ConsumerCryptoFailureAction getCryptoFailureAction() const; + + /** + * Set the CryptoFailureAction for the reader. + */ + ReaderConfiguration& setCryptoFailureAction(ConsumerCryptoFailureAction action); + + /** + * 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 + */ + ReaderConfiguration& setProperty(const std::string& name, const std::string& value); + + /** + * Add all the properties in the provided map + */ + ReaderConfiguration& setProperties(const std::map<std::string, std::string>& properties); + + private: + std::shared_ptr<ReaderConfigurationImpl> impl_; +}; +} // namespace pulsar +#endif /* PULSAR_READER_CONFIGURATION_H_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZkACgkQT0AbyNP5 ++1WMtg/8DxkbG+xpTQlzYFR0+GalOKPc2M3wTkq2QR5QKOhFLkBhF9v2SP7aN56z +K/EhD2eSCpvUAAdqZTuM1KvOROGEVK4OOO0Bb9ll+NzGQlg6PTe2uOB0+nRWQ5ED +GCcFnIdA1u/2hZi0mNAp26J5OdF4hbvXFKhttzlnEFQKXhFGNuQmm4d93u0qJXft +uY1tnhjMg2jQPSB9+tBnX+ykL2cnnNp3kZr4LKLkVEbO3iBq75md9CZHflPwgBLM +ZVSYnngaGx2+FTP6fe89AxnRgH9mvO2jaweG/6feSnK9vOWl26Q9xu4UaZKfyOrD +YlkWs84yYtUYjfG9YMPIvZ1sxbnXQcbijoWyTJH4/rmIwBbSVtaqfr1/L8SEAQS8 +BoJl0m1gvPd4Y81zTOpF2DlpAoj7HMZiEcS2jqz96brqiJwxzu1DayP4pgjiJcAc +RXzBS5H8iJn7iEfDV6WEoC5LjQZi6as52k4waN0Heqyn/lXZiWQd80tnZBg28TMY +yFJPIl++bpezTWCZJOwomhE0sb7ZpbHYqi0Xiyz0eRtZA+3cfCjBUzT6v1L5IS4+ +YJpf6+jn0AVNKnxi9rxH9LZ47iUVcddKKTkbOvDebSuOz3RMjy4HBbUlBwexXnkY +cwWq2ptbEN7NDUaN+SLX1rdYhsAxQhTQyd4bgs/CmrmPyLU5Mdc= +=BZMD +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/ReaderConfiguration.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +972a8f7aa1f680d6c2029ee10919e0286991879309c3fa01d6a17042d188ef7ea30ddbdf6d5abea59111419275d94b32c8e0e2e5b56b5238062aa78e9bdeadf5 ./x64-windows-static/include/pulsar/ReaderConfiguration.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,103 @@ +/** + * 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 ERROR_HPP_ +#define ERROR_HPP_ + +#include <pulsar/defines.h> + +#include <iosfwd> + +namespace pulsar { + +/** + * Collection of return codes + */ +enum Result +{ + ResultRetryable = -1, /// An internal error code used for retry + ResultOk = 0, /// Operation successful + + ResultUnknownError, /// Unknown error happened on broker + + ResultInvalidConfiguration, /// Invalid configuration + + ResultTimeout, /// Operation timed out + ResultLookupError, /// Broker lookup failed + ResultConnectError, /// Failed to connect to broker + ResultReadError, /// Failed to read from socket + + ResultAuthenticationError, /// Authentication failed on broker + ResultAuthorizationError, /// Client is not authorized to create producer/consumer + ResultErrorGettingAuthenticationData, /// Client cannot find authorization data + + ResultBrokerMetadataError, /// Broker failed in updating metadata + ResultBrokerPersistenceError, /// Broker failed to persist entry + ResultChecksumError, /// Corrupt message checksum failure + + ResultConsumerBusy, /// Exclusive consumer is already connected + ResultNotConnected, /// Producer/Consumer is not currently connected to broker + ResultAlreadyClosed, /// Producer/Consumer is already closed and not accepting any operation + + ResultInvalidMessage, /// Error in publishing an already used message + + ResultConsumerNotInitialized, /// Consumer is not initialized + ResultProducerNotInitialized, /// Producer is not initialized + ResultProducerBusy, /// Producer with same name is already connected + ResultTooManyLookupRequestException, /// Too Many concurrent LookupRequest + + ResultInvalidTopicName, /// Invalid topic name + ResultInvalidUrl, /// Client Initialized with Invalid Broker Url (VIP Url passed to Client Constructor) + ResultServiceUnitNotReady, /// Service Unit unloaded between client did lookup and producer/consumer got + /// created + ResultOperationNotSupported, + ResultProducerBlockedQuotaExceededError, /// Producer is blocked + ResultProducerBlockedQuotaExceededException, /// Producer is getting exception + ResultProducerQueueIsFull, /// Producer queue is full + ResultMessageTooBig, /// Trying to send a messages exceeding the max size + ResultTopicNotFound, /// Topic not found + ResultSubscriptionNotFound, /// Subscription not found + ResultConsumerNotFound, /// Consumer not found + ResultUnsupportedVersionError, /// Error when an older client/version doesn't support a required feature + ResultTopicTerminated, /// Topic was already terminated + ResultCryptoError, /// Error when crypto operation fails + + ResultIncompatibleSchema, /// Specified schema is incompatible with the topic's schema + ResultConsumerAssignError, /// Error when a new consumer connected but can't assign messages to this + /// consumer + ResultCumulativeAcknowledgementNotAllowedError, /// Not allowed to call cumulativeAcknowledgement in + /// Shared and Key_Shared subscription mode + ResultTransactionCoordinatorNotFoundError, /// Transaction coordinator not found + ResultInvalidTxnStatusError, /// Invalid txn status error + ResultNotAllowedError, /// Not allowed + ResultTransactionConflict, /// Transaction ack conflict + ResultTransactionNotFound, /// Transaction not found + ResultProducerFenced, /// Producer was fenced by broker + + ResultMemoryBufferIsFull, /// Client-wide memory limit has been reached + + ResultInterrupted, /// Interrupted while waiting to dequeue +}; + +// Return string representation of result code +PULSAR_PUBLIC const char* strResult(Result result); + +PULSAR_PUBLIC std::ostream& operator<<(std::ostream& s, pulsar::Result result); +} // namespace pulsar + +#endif /* ERROR_HPP_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZgACgkQT0AbyNP5 ++1U75xAAm5iYJ4BgZDOhkxIKIUcovgsXG3ajUkfrPQ1DCKUvlEtR6YpGp/5Wo8B+ +/jU4pObS/OrvX1QXXPeENLkjS/DmhKZrLxizcrPieDkcIVZvMeTDKRsqLTQ+dRHN +pO+pT3EMPoIzmaxF+4ynKqgB6w1gnNTZG3Zx+4vf8Ze2E+1yoLiAt7gGP22iltTi +2UNjUQWHdMMOOfyQdJuTQK+xpWwycReIgOiqidxB3MZsttmUkZS4mHTcXinXeZbj +be7HMfO8wnxZjJxwkY797XCwLTg6c4+7H9F5S/l3JJIeY80tEOPBj8Hw0yCKgQ1w +vqGXOD+MyV2HxuX3YVpDfvkavLLQpAI74XRv7e7XuNMiKfMnOPNliCItVC6y5pKs +gRDBRn1e7Q6yLQy6RShcaHOLe02jJRPFyZryReS77QkT/fQYnapfa71qItc6Aizq +8pLKYhMLO2NrQpKnkt8HQc9qHHpM7zCbaIdwBie/7nDvrHTR7rAJDL4XZ8yLO4y3 +rQhUFssUHEU02ykDzppyq4aor7U/gROe3xzVsqmBgGbREef7C5O8CXlifkZ1Mh5V +7PB5V+BHyzuuVoEvvw9aVdL3naxx/xyxMf68GBaBR5BMMzIjeqMuQEAR5wO3yBBH +0bU/oexJZW5bsHi5vtYCno5++En85OJnnH9KJbmsXXPBSAEPd1g= +=5jLK +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Result.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +55d254c16dacecf099ccf89b7bbf7f8d8587fe00800d8bbf1001f6ec22a3a50b2330c76b96bbfaddd21f1e3db438f6615fef9211c63764cb5c6067ec7c54f483 ./x64-windows-static/include/pulsar/Result.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,205 @@ +/** + * 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 <iosfwd> +#include <map> +#include <memory> +#include <string> + +namespace pulsar { + +/** + * Encoding types of supported KeyValueSchema for Pulsar messages. + */ +enum class KeyValueEncodingType +{ + /** + * Key is stored as message key, while value is stored as message payload. + */ + SEPARATED, + + /** + * Key and value are stored as message payload. + */ + INLINE +}; + +// Return string representation of result code +PULSAR_PUBLIC const char *strEncodingType(pulsar::KeyValueEncodingType encodingType); + +PULSAR_PUBLIC KeyValueEncodingType enumEncodingType(std::string encodingTypeStr); + +enum SchemaType +{ + /** + * No schema defined + */ + NONE = 0, + + /** + * Simple String encoding with UTF-8 + */ + STRING = 1, + + /** + * JSON object encoding and validation + */ + JSON = 2, + + /** + * Protobuf message encoding and decoding + */ + PROTOBUF = 3, + + /** + * Serialize and deserialize via Avro + */ + AVRO = 4, + + /** + * A 8-byte integer. + */ + INT8 = 6, + + /** + * A 16-byte integer. + */ + INT16 = 7, + + /** + * A 32-byte integer. + */ + INT32 = 8, + + /** + * A 64-byte integer. + */ + INT64 = 9, + + /** + * A float number. + */ + FLOAT = 10, + + /** + * A double number + */ + DOUBLE = 11, + + /** + * A Schema that contains Key Schema and Value Schema. + */ + KEY_VALUE = 15, + + /** + * Protobuf native schema based on Descriptor. + */ + PROTOBUF_NATIVE = 20, + + /** + * A bytes array. + */ + BYTES = -1, + + /** + * Auto Consume Type. + */ + AUTO_CONSUME = -3, + + /** + * Auto Publish Type. + */ + AUTO_PUBLISH = -4, +}; + +// Return string representation of result code +PULSAR_PUBLIC const char *strSchemaType(SchemaType schemaType); + +class SchemaInfoImpl; + +typedef std::map<std::string, std::string> StringMap; + +/** + * Encapsulates data around the schema definition + */ +class PULSAR_PUBLIC SchemaInfo { + public: + /** + * The default constructor with following configs: + * - schemaType: SchemaType::BYTES + * - name: "BYTES" + * - schema: "" + * - properties: {} + * + * @see SchemaInfo(SchemaType schemaType, const std::string& name, const std::string& schema, const + * StringMap& properties) + */ + SchemaInfo(); + + /** + * @param schemaType the schema type + * @param name the name of the schema definition + * @param schema the schema definition as a JSON string + * @param properties a map of custom defined properties attached to the schema + */ + SchemaInfo(SchemaType schemaType, const std::string &name, const std::string &schema, + const StringMap &properties = StringMap()); + + /** + * @param keySchema the key schema. + * @param valueSchema the value schema. + * @param keyValueEncodingType Encoding types of supported KeyValueSchema for Pulsar messages. + */ + SchemaInfo(const SchemaInfo &keySchema, const SchemaInfo &valueSchema, + const KeyValueEncodingType &keyValueEncodingType = KeyValueEncodingType::INLINE); + + /** + * @return the schema type + */ + SchemaType getSchemaType() const; + + /** + * @return the name of the schema definition + */ + const std::string &getName() const; + + /** + * @return the schema definition as a JSON string + */ + const std::string &getSchema() const; + + /** + * @return a map of custom defined properties attached to the schema + */ + const StringMap &getProperties() const; + + private: + typedef std::shared_ptr<SchemaInfoImpl> SchemaInfoImplPtr; + SchemaInfoImplPtr impl_; + static constexpr uint32_t INVALID_SIZE = 0xFFFFFFFF; +}; + +} // namespace pulsar + +PULSAR_PUBLIC std::ostream &operator<<(std::ostream &s, pulsar::SchemaType schemaType); + +PULSAR_PUBLIC std::ostream &operator<<(std::ostream &s, pulsar::KeyValueEncodingType encodingType); Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZkACgkQT0AbyNP5 ++1UxHA//c8UySfo15V44wvE3JwXTWvUYD1ALkJgGylWDXhTsIMwyEGjWOvKF+pbD +l16MxltuEnqGzEdLGxeaQQ5qSQOEpfGrgh4N162586jmMQKgSSQBWKl5GLCG/X1v +FylDIpT7AjYR0O+nmuCl1QwXbe6O/EqVRHp/AWDcmViz0hx5M05LfI35M4LQoVBO +jnVBPfWKmHV0Uax1eEWx9YFXhdHsJ4kxEM7GrHy89FdsUMsrIXl9ufD40CwVLrm0 +f8m9/AHhFWg0CIVDlqAwOfNv7VUBt+nT/3Zg1kmIMoOPz5cET5ofMBxmZE5dDqic +Nva3gNAAKgs3RQXkHdI0czo9jnMCPPwVM1awq6r7+Y5E49H9g/MXsbAjAeRUdTm6 +8osqyssaxhoI+SJsgz/SlRBY6gz4Qwq8kOCw0hpgMFJkgMJf0rA55ATRsOKTPeLG +dt1qdGBHIzrRa2L0Xo9QasmTO07D2XtfyufEHQRDHGTxefwZ8NeKFQLbVRjKVhZK +1zZhG28UefAe7l5g0oROrBDMGgTmEIWzqx1aaW0x3drSJXSX3MdPBTPxTemAtSgc +4lm6KQOiUf0nEtsIuqwYEiBq+X1yXAAgeKMNqSzuvahsTFwa9dV+tdy4Nj4MLN2C +nWsVBXWvq53RaRXlmJgSoW/hKQeR9DqHu9JTGPXdSOhGj2myzXY= +=COvy +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/Schema.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +e639835b1d823733cace08c09690906d280c9c318a4a76795b80ceb5e51e0251df274b58ad73ac350d6946f7c068762ad47bf6e41d36963f43d0d7ca6b6bcbc7 ./x64-windows-static/include/pulsar/Schema.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,39 @@ +/** + * 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 TOPIC_METADATA_HPP_ +#define TOPIC_METADATA_HPP_ + +#include <pulsar/defines.h> + +namespace pulsar { +/** + * Metadata of a topic that can be used for message routing. + */ +class PULSAR_PUBLIC TopicMetadata { + public: + virtual ~TopicMetadata() {} + + /** + * @return the number of partitions + */ + virtual int getNumPartitions() const = 0; +}; +} // namespace pulsar + +#endif /* TOPIC_METADATA_HPP_ */ Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZsACgkQT0AbyNP5 ++1U+BRAApW6mWFUlvNGm46CQGfecuEMI0drVXT2uBYgIRsKTxSs00ScsMjoCXoLR +cABnJ79ossYHIIFY4NaIhXdNmj31gsezvOXAfK60arWj79eMYTY67jnYvWoPu+2I +sKT/yyZ1XY3FsfS8j7/PAtH6RxePkhRCnCFttWPM82f9vZvxWYX0hK5KSYiBcEwA +/EnbpzZ4eiePU9CzR7GKu18u9Uq4A7FeOy21qULjeiksTqYpQU+ivNtpcZtdQlSo +9Cc4Al1tT3rhMKFILpVZ+35aTtcy54rk98N6yAf/jmNtiyegvzvpAhxE7Rh4HcM5 +xZecYZh4dX6ZAjwjgbHlufBZlt3geCKOZjU424I7k/ByqH7snohB//UyZm82i+Jc +AnzABZw3KUvO2eB7Sl2+gabdbqbTC/ohU2YeqOUT3Q0f09clLXXVvxhyp5iv65n5 +B8D9a2UM7XROz17C1O9JQclLZQ7V16KlZKI/B/xxItSTNp6sVBtLPAHQn63DKme+ +lhEucj5ASZYo09GYOjArS5qRCqo9r9n0hdVOuUV5Oc+pkSdotS023kb2QdS5wOcK +MmcsBOSsW29hwHOigg0pO24WKR7a1Xw9iovuoWHMv1y1KOnozqAG1XYIN5yY9IoO +uEzhvV97huEPettLrhqPWP82NZxuqDVmuLDMLYXP/xlQF1WcDoo= +=ltX7 +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/TopicMetadata.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +cdbc3d4482794955af446aa6f828122ea0f040bd6d329ae710eee7e81dd44a2991507f35aff11007142ad72dd335019cc2d350745e68b15afc7561b702f3d250 ./x64-windows-static/include/pulsar/TopicMetadata.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,53 @@ +/** + * 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> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _pulsar_authentication pulsar_authentication_t; + +typedef char *(*token_supplier)(void *); + +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_create(const char *dynamicLibPath, + const char *authParamsString); + +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_tls_create(const char *certificatePath, + const char *privateKeyPath); + +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_token_create(const char *token); +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_token_create_with_supplier( + token_supplier tokenSupplier, void *ctx); + +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_basic_create(const char *username, + const char *password); + +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_athenz_create(const char *authParamsString); + +PULSAR_PUBLIC pulsar_authentication_t *pulsar_authentication_oauth2_create(const char *authParamsString); + +PULSAR_PUBLIC void pulsar_authentication_free(pulsar_authentication_t *authentication); + +#ifdef __cplusplus +} +#endif \ No newline at end of file Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZ8ACgkQT0AbyNP5 ++1Xn4BAAsP79dUxRkGwlJRmPliLAX6DvUbczidpL/qoLK//V11nZLs57LOGrQ5sB +vDmHzY9gsVyzME3Kpf+hpBlTEBw8HGRs7DSz3KFB8Chrj1EpMKsBJs6Hn0fQzU7U +h1GCyWBVIUB1yt49yXpAfoz6/44CIFyfdmRrcNF/TvjypdbctfzBbe/YHJ7qzMjH +IPNvZbpn1Sv0n3v/EK9XwHHrqgtawpdSJbv55tgXyTGPjl5RA3Rt1JV1LXI1dgVt +2HVwuzb3ty8RtuuOswQMppn6iORIJiEquiTH+6JJgl4Hr0rr65JNh422pBDyo5Vb +RU0An9ZRDMmpY+Ng2+FczWicwL8e5Pg3e9hIkTZfiIZtzsFaI5vcN8hisroa7Qkn +lEjj7L//nDj8ZolIX6H6LgOE8h/nASdswmjp7IHLItlubwyXXvXMzV7PQMXp6oQU +MxAk2h4nyRzhsKYscZyF2VKRSH3U0BRJk6LAd7ccigSqQB661mHws6yyAJp8+187 +290TeWX2Isz1xhpS8JXcFk9CRht/gfalJ1UUY0Oup+5c/QNnOpcVULnURnEiUL94 +14mJuZ4e3pDFPT5rKTYU9rN2BT8dqxcYMrKuX07D+Is8emMLleiKcRxhnUbWW0TX +jQW43gWkEbXnwhwgMJKxeDSdZ+SledYZn6tvmXj7xIqv4HYQBzI= +=HgyI +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/authentication.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +72731c4c1e8a5c6b6daa415731bd51419797e49f3f9bea22e1439e76fc40154dc585dd3722628d1c757621f34ce3ccd592d776663683913abd749b7722f3da36 ./x64-windows-static/include/pulsar/c/authentication.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,192 @@ +/** + * 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/c/client_configuration.h> +#include <pulsar/c/consumer.h> +#include <pulsar/c/consumer_configuration.h> +#include <pulsar/c/message.h> +#include <pulsar/c/message_id.h> +#include <pulsar/c/producer.h> +#include <pulsar/c/producer_configuration.h> +#include <pulsar/c/reader.h> +#include <pulsar/c/reader_configuration.h> +#include <pulsar/c/result.h> +#include <pulsar/c/string_list.h> +#include <pulsar/defines.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _pulsar_client pulsar_client_t; +typedef struct _pulsar_producer pulsar_producer_t; +typedef struct _pulsar_string_list pulsar_string_list_t; + +typedef struct _pulsar_client_configuration pulsar_client_configuration_t; +typedef struct _pulsar_producer_configuration pulsar_producer_configuration_t; + +typedef void (*pulsar_create_producer_callback)(pulsar_result result, pulsar_producer_t *producer, void *ctx); + +typedef void (*pulsar_subscribe_callback)(pulsar_result result, pulsar_consumer_t *consumer, void *ctx); +typedef void (*pulsar_reader_callback)(pulsar_result result, pulsar_reader_t *reader, void *ctx); +typedef void (*pulsar_get_partitions_callback)(pulsar_result result, pulsar_string_list_t *partitions, + void *ctx); + +typedef void (*pulsar_close_callback)(pulsar_result result, void *ctx); + +/** + * Create a Pulsar client object connecting to the specified cluster address and using the specified + * configuration. + * + * @param serviceUrl the Pulsar endpoint to use (eg: pulsar://broker-example.com:6650) + * @param clientConfiguration the client configuration to use + */ +PULSAR_PUBLIC pulsar_client_t *pulsar_client_create(const char *serviceUrl, + const pulsar_client_configuration_t *clientConfiguration); + +/** + * Create a producer with default configuration + * + * @see createProducer(const std::string&, const ProducerConfiguration&, Producer&) + * + * @param topic the topic where the new producer will publish + * @param producer a non-const reference where the new producer will be copied + * @return ResultOk if the producer has been successfully created + * @return ResultError if there was an error + */ +PULSAR_PUBLIC pulsar_result pulsar_client_create_producer(pulsar_client_t *client, const char *topic, + const pulsar_producer_configuration_t *conf, + pulsar_producer_t **producer); + +PULSAR_PUBLIC void pulsar_client_create_producer_async(pulsar_client_t *client, const char *topic, + const pulsar_producer_configuration_t *conf, + pulsar_create_producer_callback callback, void *ctx); + +PULSAR_PUBLIC pulsar_result pulsar_client_subscribe(pulsar_client_t *client, const char *topic, + const char *subscriptionName, + const pulsar_consumer_configuration_t *conf, + pulsar_consumer_t **consumer); + +PULSAR_PUBLIC void pulsar_client_subscribe_async(pulsar_client_t *client, const char *topic, + const char *subscriptionName, + const pulsar_consumer_configuration_t *conf, + pulsar_subscribe_callback callback, void *ctx); + +/** + * Create a consumer to multiple topics under the same namespace with default configuration + * + * @see subscribe(const std::vector<std::string>&, const std::string&, Consumer& consumer) + * + * @param topics a list of topic names to subscribe to + * @param topicsCount the number of topics + * @param subscriptionName the subscription name + * @param consumer a non-const reference where the new consumer will be copied + * @return ResultOk if the consumer has been successfully created + * @return ResultError if there was an error + */ +PULSAR_PUBLIC pulsar_result pulsar_client_subscribe_multi_topics(pulsar_client_t *client, const char **topics, + int topicsCount, + const char *subscriptionName, + const pulsar_consumer_configuration_t *conf, + pulsar_consumer_t **consumer); + +PULSAR_PUBLIC void pulsar_client_subscribe_multi_topics_async(pulsar_client_t *client, const char **topics, + int topicsCount, const char *subscriptionName, + const pulsar_consumer_configuration_t *conf, + pulsar_subscribe_callback callback, void *ctx); + +/** + * Create a consumer to multiple (which match given topicPattern) with default configuration + * + * @see subscribeWithRegex(const std::string&, const std::string&, Consumer& consumer) + * + * @param topicPattern topic regex topics should match to subscribe to + * @param subscriptionName the subscription name + * @param consumer a non-const reference where the new consumer will be copied + * @return ResultOk if the consumer has been successfully created + * @return ResultError if there was an error + */ +PULSAR_PUBLIC pulsar_result pulsar_client_subscribe_pattern(pulsar_client_t *client, const char *topicPattern, + const char *subscriptionName, + const pulsar_consumer_configuration_t *conf, + pulsar_consumer_t **consumer); + +PULSAR_PUBLIC void pulsar_client_subscribe_pattern_async(pulsar_client_t *client, const char *topicPattern, + const char *subscriptionName, + const pulsar_consumer_configuration_t *conf, + pulsar_subscribe_callback callback, void *ctx); + +/** + * Create a topic reader with given {@code ReaderConfiguration} for reading messages from the specified + * topic. + * <p> + * The Reader provides a low-level abstraction that allows for manual positioning in the topic, without + * using a + * subscription. Reader can only work on non-partitioned topics. + * <p> + * The initial reader positioning is done by specifying a message id. The options are: + * <ul> + * <li><code>MessageId.earliest</code> : Start reading from the earliest message available in the topic + * <li><code>MessageId.latest</code> : Start reading from the end topic, only getting messages published + * after the + * reader was created + * <li><code>MessageId</code> : When passing a particular message id, the reader will position itself on + * that + * specific position. The first message to be read will be the message next to the specified messageId. + * </ul> + * + * @param topic + * The name of the topic where to read + * @param startMessageId + * The message id where the reader will position itself. The first message returned will be the + * one after + * the specified startMessageId + * @param conf + * The {@code ReaderConfiguration} object + * @return The {@code Reader} object + */ +PULSAR_PUBLIC pulsar_result pulsar_client_create_reader(pulsar_client_t *client, const char *topic, + const pulsar_message_id_t *startMessageId, + pulsar_reader_configuration_t *conf, + pulsar_reader_t **reader); + +PULSAR_PUBLIC void pulsar_client_create_reader_async(pulsar_client_t *client, const char *topic, + const pulsar_message_id_t *startMessageId, + pulsar_reader_configuration_t *conf, + pulsar_reader_callback callback, void *ctx); + +PULSAR_PUBLIC pulsar_result pulsar_client_get_topic_partitions(pulsar_client_t *client, const char *topic, + pulsar_string_list_t **partitions); + +PULSAR_PUBLIC void pulsar_client_get_topic_partitions_async(pulsar_client_t *client, const char *topic, + pulsar_get_partitions_callback callback, + void *ctx); + +PULSAR_PUBLIC pulsar_result pulsar_client_close(pulsar_client_t *client); + +PULSAR_PUBLIC void pulsar_client_close_async(pulsar_client_t *client, pulsar_close_callback callback, + void *ctx); + +PULSAR_PUBLIC void pulsar_client_free(pulsar_client_t *client); + +#ifdef __cplusplus +} +#endif Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZwACgkQT0AbyNP5 ++1WIshAAkjsvrMzxdPPo+dUaBoqBSGwR6AT/q3TGGOcmXTUTFzaMi+UlAD1zTnJ0 +cEMW9NFCTDd5JPgVzLY+pJrqvYbavrvOtDSNB1u5DYiI77BcgGIHpznEPBS8qtwg +br4Dt0SvETZux40eLO5PC9jZKyWuH38H2hOs0cXg/cuwpU8pgMR2QzoEeOSILTVv +xZ800MgvBvOR+w3tDHKgraROK9cJgz8eIWDnJGHNWMHAVbZLYAG80qo7x9cTVklW +pY1vLBX0jx8B+mCMES0KemdYQpay7wno7fFjRq1tZu+IafEWLueZABwUvuTqpUqL +sgibTxjdL+t7Q0yGBKhgrect24gVTqFOFH7oQnhdR0dBGg0XqU9wQH5HgVtpEQ5c +hkhy7tlHo4AkWOYqpfHN9M/pnE/jEtpp3LJ3Mjsc5489r6800Ag0i2/U4bFcRGni +Gp3KkNMEwj2yUi2jnimueStJbLoPjXo+pME9jW69l859p16RzJcH9t2rJP+RwIhk +avnyv+yILu3mSv7p0UjQv3mJL00971sUT6hRq1xPhvXrWV4cokRQ/yXFd/9bH2w6 +rVXeQmhi69mN4qGD6OKJRfSldVcHjuJwo8rFLMNBURXg/1WcyFwrWd6/r/llINIH +JRBQQ01sYe+mT13lnnYLecvxjwUv0zd1OFq3y2cv0k0JnUEF6p4= +=L0CF +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +40b6df5e7456c07ffcfab7709b6837d7cff45387fa50db2940d3295711f5468b06015f1864675fafbf992417d7ed43091c02caace30eb2f4992c3badc2186f48 ./x64-windows-static/include/pulsar/c/client.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,173 @@ +/** + * 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> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + pulsar_DEBUG = 0, + pulsar_INFO = 1, + pulsar_WARN = 2, + pulsar_ERROR = 3 +} pulsar_logger_level_t; + +typedef void (*pulsar_logger)(pulsar_logger_level_t level, const char *file, int line, const char *message, + void *ctx); + +typedef struct _pulsar_client_configuration pulsar_client_configuration_t; +typedef struct _pulsar_authentication pulsar_authentication_t; + +PULSAR_PUBLIC pulsar_client_configuration_t *pulsar_client_configuration_create(); + +PULSAR_PUBLIC void pulsar_client_configuration_free(pulsar_client_configuration_t *conf); + +/** + * Set the authentication method to be used with the broker + * + * @param authentication the authentication data to use + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_auth(pulsar_client_configuration_t *conf, + pulsar_authentication_t *authentication); + +/** + * Configure a limit on the amount of memory that will be allocated by this client instance. + * Setting this to 0 will disable the limit. By default this is disabled. + * + * @param memoryLimitBytes the memory limit + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_memory_limit(pulsar_client_configuration_t *conf, + unsigned long long memoryLimitBytes); + +/** + * @return the client memory limit in bytes + */ +PULSAR_PUBLIC unsigned long long pulsar_client_configuration_get_memory_limit( + pulsar_client_configuration_t *conf); + +/** + * Set timeout on client operations (subscribe, create producer, close, unsubscribe) + * Default is 30 seconds. + * + * @param timeout the timeout after which the operation will be considered as failed + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_operation_timeout_seconds( + pulsar_client_configuration_t *conf, int timeout); + +/** + * @return the client operations timeout in seconds + */ +PULSAR_PUBLIC int pulsar_client_configuration_get_operation_timeout_seconds( + pulsar_client_configuration_t *conf); + +/** + * Set the number of IO threads to be used by the Pulsar client. Default is 1 + * thread. + * + * @param threads number of threads + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_io_threads(pulsar_client_configuration_t *conf, + int threads); + +/** + * @return the number of IO threads to use + */ +PULSAR_PUBLIC int pulsar_client_configuration_get_io_threads(pulsar_client_configuration_t *conf); + +/** + * Set the number of threads to be used by the Pulsar client when delivering messages + * through message listener. Default is 1 thread per Pulsar client. + * + * If using more than 1 thread, messages for distinct MessageListener will be + * delivered in different threads, however a single MessageListener will always + * be assigned to the same thread. + * + * @param threads number of threads + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_message_listener_threads( + pulsar_client_configuration_t *conf, int threads); + +/** + * @return the number of IO threads to use + */ +PULSAR_PUBLIC int pulsar_client_configuration_get_message_listener_threads( + pulsar_client_configuration_t *conf); + +/** + * Number of concurrent lookup-requests allowed on each broker-connection to prevent overload on broker. + * <i>(default: 50000)</i> It should be configured with higher value only in case of it requires to + * produce/subscribe on + * thousands of topic using created {@link PulsarClient} + * + * @param concurrentLookupRequest + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_concurrent_lookup_request( + pulsar_client_configuration_t *conf, int concurrentLookupRequest); + +/** + * @return Get configured total allowed concurrent lookup-request. + */ +PULSAR_PUBLIC int pulsar_client_configuration_get_concurrent_lookup_request( + pulsar_client_configuration_t *conf); + +PULSAR_PUBLIC void pulsar_client_configuration_set_logger(pulsar_client_configuration_t *conf, + pulsar_logger logger, void *ctx); + +PULSAR_PUBLIC void pulsar_client_configuration_set_use_tls(pulsar_client_configuration_t *conf, int useTls); + +PULSAR_PUBLIC int pulsar_client_configuration_is_use_tls(pulsar_client_configuration_t *conf); + +PULSAR_PUBLIC void pulsar_client_configuration_set_tls_trust_certs_file_path( + pulsar_client_configuration_t *conf, const char *tlsTrustCertsFilePath); + +PULSAR_PUBLIC const char *pulsar_client_configuration_get_tls_trust_certs_file_path( + pulsar_client_configuration_t *conf); + +PULSAR_PUBLIC void pulsar_client_configuration_set_tls_allow_insecure_connection( + pulsar_client_configuration_t *conf, int allowInsecure); + +PULSAR_PUBLIC int pulsar_client_configuration_is_tls_allow_insecure_connection( + pulsar_client_configuration_t *conf); + +/* + * Initialize stats interval in seconds. Stats are printed and reset after every 'statsIntervalInSeconds'. + * Set to 0 in order to disable stats collection. + */ +PULSAR_PUBLIC void pulsar_client_configuration_set_stats_interval_in_seconds( + pulsar_client_configuration_t *conf, const unsigned int interval); + +PULSAR_PUBLIC int pulsar_client_configuration_is_validate_hostname(pulsar_client_configuration_t *conf); + +PULSAR_PUBLIC void pulsar_client_configuration_set_validate_hostname(pulsar_client_configuration_t *conf, + int validateHostName); + +/* + * Get the stats interval set in the client. + */ +PULSAR_PUBLIC const unsigned int pulsar_client_configuration_get_stats_interval_in_seconds( + pulsar_client_configuration_t *conf); + +#ifdef __cplusplus +} +#endif Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZ8ACgkQT0AbyNP5 ++1VWCg//dDp2DH2z9dZTdOmHXEb29BCP5KNwLMOqduvgDTaG7CqJM2dk8zynhBNj +HZe/nCqMZD6AYo/NSelpnZT7iwY5kM+NQy3/oICj1Ov6uLvnuXH6h52coJUJd8rJ +4Ow9chbbMSnv/8ByTDZACjesCdZCnHg8aFq1CyB5VPdm+diSCw5apsgPIKPnZYL7 +r98RVySrWkrLElS1gXXmnnn4GTf6U0PQGQA++aKIoyAh2TTb/zc7nui359q2oISh +5wIkuivjMaxArbAbDr2to2yKdx2f+pLvbUs0j8/o3WihnJ26FOcpTEr2Ral715OB +S9e9mm+bTKiXQPkCvjkXEJQHIpzD2t4aXY2bUP0YUO+HPHNELfRmQ8fqUV4CZ/7Z +3axWZeIGoaguufp2z3EBEip2kp7R43eUoy0VrgWuGRKgB1/+emVh/7RDjj24co5Z +qBkv2hO6XxWqaK0oYnoR8qyr5CY72alkO0F2gEA2OEFLdJLDIFhNWW3ikvM1nMON +O26D1c8+aHVn1BhCsRSNCV2ZivGsDbn7NwXcA4ZZzSQ0E3mRYHljuGZd2ySkkXsf +zE87KaQ3mI+LgeZa/nCLppBOL/IDcGxqtjJpqAjzNbTFjNd6O+EMqtYpP1HtjisW +K47OwOoWl9j4WF2WWZEd6BFtPzSnv0xITheRk99CO3v1ybpJyJI= +=8dG0 +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/client_configuration.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +0dc43cec729e75e2c15b73f8a51157ececc86665c414349afab33693f980f69983e0daf1911d0894f78b61c799824addc3be467c49fe638063c3db3f2ad43f70 ./x64-windows-static/include/pulsar/c/client_configuration.h Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h Wed Nov 23 09:18:55 2022 @@ -0,0 +1,296 @@ +/** + * 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> + +#ifdef __cplusplus +extern "C" { +#endif + +#include <pulsar/c/message.h> +#include <pulsar/c/result.h> +#include <stdint.h> + +typedef struct _pulsar_consumer pulsar_consumer_t; + +typedef void (*pulsar_result_callback)(pulsar_result, void *); + +typedef void (*pulsar_receive_callback)(pulsar_result result, pulsar_message_t *msg, void *ctx); + +/** + * @return the topic this consumer is subscribed to + */ +PULSAR_PUBLIC const char *pulsar_consumer_get_topic(pulsar_consumer_t *consumer); + +/** + * @return the consumer name + */ +PULSAR_PUBLIC const char *pulsar_consumer_get_subscription_name(pulsar_consumer_t *consumer); + +/** + * 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 + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_unsubscribe(pulsar_consumer_t *consumer); + +/** + * 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 + */ +PULSAR_PUBLIC void pulsar_consumer_unsubscribe_async(pulsar_consumer_t *consumer, + pulsar_result_callback callback, void *ctx); + +/** + * 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 + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_receive(pulsar_consumer_t *consumer, pulsar_message_t **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 + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_receive_with_timeout(pulsar_consumer_t *consumer, + pulsar_message_t **msg, int timeoutMs); + +/** + * Asynchronously receive a single message. + * + * This method will initiate the operation and return immediately. The provided callback + * will be triggered when the operation is complete. + * + * @param callback callback that will be triggered when the message is available + */ +PULSAR_PUBLIC void pulsar_consumer_receive_async(pulsar_consumer_t *consumer, + pulsar_receive_callback callback, void *ctx); + +/** + * 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 + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge(pulsar_consumer_t *consumer, + pulsar_message_t *message); + +PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge_id(pulsar_consumer_t *consumer, + pulsar_message_id_t *messageId); + +/** + * 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 + */ +PULSAR_PUBLIC void pulsar_consumer_acknowledge_async(pulsar_consumer_t *consumer, pulsar_message_t *message, + pulsar_result_callback callback, void *ctx); + +PULSAR_PUBLIC void pulsar_consumer_acknowledge_async_id(pulsar_consumer_t *consumer, + pulsar_message_id_t *messageId, + pulsar_result_callback callback, void *ctx); + +/** + * 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 + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge_cumulative(pulsar_consumer_t *consumer, + pulsar_message_t *message); + +PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge_cumulative_id(pulsar_consumer_t *consumer, + pulsar_message_id_t *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 + */ +PULSAR_PUBLIC void pulsar_consumer_acknowledge_cumulative_async(pulsar_consumer_t *consumer, + pulsar_message_t *message, + pulsar_result_callback callback, void *ctx); + +PULSAR_PUBLIC void pulsar_consumer_acknowledge_cumulative_async_id(pulsar_consumer_t *consumer, + pulsar_message_id_t *messageId, + pulsar_result_callback callback, + void *ctx); + +/** + * 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. + * + * @param message + * The {@code Message} to be acknowledged + */ +PULSAR_PUBLIC void pulsar_consumer_negative_acknowledge(pulsar_consumer_t *consumer, + pulsar_message_t *message); + +/** + * Acknowledge the failure to process a single message through its message id + * <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. + * + * @param message + * The message id to be acknowledged + */ +PULSAR_PUBLIC void pulsar_consumer_negative_acknowledge_id(pulsar_consumer_t *consumer, + pulsar_message_id_t *messageId); + +PULSAR_PUBLIC pulsar_result pulsar_consumer_close(pulsar_consumer_t *consumer); + +PULSAR_PUBLIC void pulsar_consumer_close_async(pulsar_consumer_t *consumer, pulsar_result_callback callback, + void *ctx); + +PULSAR_PUBLIC void pulsar_consumer_free(pulsar_consumer_t *consumer); + +/* + * Pause receiving messages via the messageListener, till resumeMessageListener() is called. + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_pause_message_listener(pulsar_consumer_t *consumer); + +/* + * Resume receiving the messages via the messageListener. + * Asynchronously receive all the messages enqueued from time pauseMessageListener() was called. + */ +PULSAR_PUBLIC pulsar_result resume_message_listener(pulsar_consumer_t *consumer); + +/** + * 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. + */ +PULSAR_PUBLIC void pulsar_consumer_redeliver_unacknowledged_messages(pulsar_consumer_t *consumer); + +/** + * Reset the subscription associated with this consumer to a specific message id. + * + * @param consumer The consumer + * @param messageId The message id can either be a specific message or represent the first or last messages in + * the topic. + * @param callback The callback for this async operation + * @param ctx The context for the callback + */ +PULSAR_PUBLIC void pulsar_consumer_seek_async(pulsar_consumer_t *consumer, pulsar_message_id_t *messageId, + pulsar_result_callback callback, void *ctx); + +/** + * Reset the subscription asynchronously associated with this consumer to a specific message id. + * + * @param consumer The consumer + * @param messageId The message id can either be a specific message or represent the first or last messages in + * the topic. + * @return Operation result + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_seek(pulsar_consumer_t *consumer, pulsar_message_id_t *messageId); + +/** + * Reset the subscription associated with this consumer to a specific message publish time. + * + * @param consumer The consumer + * @param timestamp The message publish time where to reposition the subscription. The timestamp format should + * be Unix time in milliseconds. + * @param callback The callback for this async operation + * @param ctx The context for the callback + */ +PULSAR_PUBLIC void pulsar_consumer_seek_by_timestamp_async(pulsar_consumer_t *consumer, uint64_t timestamp, + pulsar_result_callback callback, void *ctx); + +/** + * Reset the subscription asynchronously associated with this consumer to a specific message publish time. + * + * @param consumer The consumer + * @param timestamp The message publish time where to reposition the subscription. The timestamp format should + * be Unix time in milliseconds. + * @return Operation result + */ +PULSAR_PUBLIC pulsar_result pulsar_consumer_seek_by_timestamp(pulsar_consumer_t *consumer, + uint64_t timestamp); + +PULSAR_PUBLIC int pulsar_consumer_is_connected(pulsar_consumer_t *consumer); + +PULSAR_PUBLIC pulsar_result pulsar_consumer_get_last_message_id(pulsar_consumer_t *consumer, + pulsar_message_id_t *messageId); + +#ifdef __cplusplus +} +#endif Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h.asc ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h.asc (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h.asc Wed Nov 23 09:18:55 2022 @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE6ItqSN52cCOQDJEjT0AbyNP5+1UFAmN9xZ4ACgkQT0AbyNP5 ++1UE2g/8CT2CfPzO8847QjW93aKdyosNflfe/6dngyyW//F+kydOn+6scYvB++Oy +VUom7OXo/UOmeRXQSIjGrUY1yFweuenwdRXLb9Mt63ye/tS91PWSWsIMhE8ey5cu +bTjcc94xKdmhQKBnklq6asxf7QPGDWuGWzlkOYj3ESg9MYPt2y2KFdpe25YTyOrv +GGnaCMxFSnzhMwIW/VgUk5uhtz5Uwn1Pesq5oXanvnICIUVpQWNpzz62rdjZj3ra +Q9tayveJ8RQCNVIIuNixIdk8OBPrYSNXJ0tk9eKCBmFVKX3l2ohHGSbm31RJXmhB +XXKkyxwOCle3UmiJGlMhVyR6M15eKmWDd69Uc2hKiVO7eSqDHXn3jQ6ives/wj39 +cC9H73tMcIKm/ECQT0fNz4tquopbhw5/w6xuMuO8ySEbfX/Kz3Km5vT2N9v+KLzv +o1w0FcKq4JYql8PyvIJa7E9pHWI12AE5u9ZP9cnaI3BxhJbDPgcTaA6zd1OPIBfo +8SB8h9l0ZpM46Lx0Z+ndc7e9V8tTpGTPC1pBjW/lq0qiY2vBOWHsqugG2f30CoN6 +Q+4nYODuDl7Z11e2lt9oGKcGfN6TswjCqElbnwp8Gh8v9ldFJE0gWfu3ZBpIgPKu +fPTfnJBUdnLBlmVvMgIuW5WFtPWza45DF0zp+vvwYQxSDLPpvLM= +=jABi +-----END PGP SIGNATURE----- Added: dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h.sha512 ============================================================================== --- dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h.sha512 (added) +++ dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/x64-windows-static/include/pulsar/c/consumer.h.sha512 Wed Nov 23 09:18:55 2022 @@ -0,0 +1 @@ +91a3193272e451c6368d2dd4776d9e7aad318d33d5ef99d80cbf412d3173ba22f1ba04646870d0a78d6cd5171b90226b72537ca0190707b37e18b4b06e6ea947 ./x64-windows-static/include/pulsar/c/consumer.h
