@return Get configured total allowed concurrent lookup-request.
@return the number of IO threads to use
@return the number of IO threads to use
@return the client operations timeout in seconds
Set the authentication method to be used with the broker
Number of concurrent lookup-requests allowed on each broker-connection to prevent overload on broker.
(default: 50000) It should be configured with higher value only in case of it requires to
produce/subscribe on
thousands of topic using created {@link PulsarClient}
Set the number of IO threads to be used by the Pulsar client. Default is 1
thread.
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.
Set timeout on client operations (subscribe, create producer, close, unsubscribe)
Default is 30 seconds.
Create a Pulsar client object connecting to the specified cluster address and using the specified
configuration.
Create a producer with default configuration
Create a topic reader with given {@code ReaderConfiguration} for reading messages from the specified
topic.
Get max number of grouped messages within one grouping time window.
Get grouping time window in milliseconds.
Get the configured delay to wait before re-delivering messages that have failed to be process.
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.
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.
Set the delay to wait before re-delivering messages that have failed to be process.
Acknowledge the reception of a single message.
Asynchronously acknowledge the reception of a single message.
Acknowledge the reception of all the messages in the stream up to (and including)
the provided message.
Asynchronously acknowledge the reception of all the messages in the stream up to (and
including) the provided message.
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.
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.
Sets the size of the consumer receive queue.
@return the configured max total receiver queue size across partitions
@return the consumer name
@return the topic this consumer is subscribed to
@return the configured timeout in milliseconds for unacked messages.
Acknowledge the failure to process a single message.
Acknowledge the failure to process a single message through its message id
Receive 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
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.
Set the max total receiver queue size across partitons.
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
Unsubscribe the current consumer from the topic.
Asynchronously unsubscribe the current consumer from the topic.
Do not replicate this message
@param flag if true, disable replication, otherwise use default
replication
Get the content of the message
Get the event timestamp associated with this message. It is set by the client producer.
Get the length of the message
Get the unique message ID associated with this message.
Get the ordering key of the message for message dispatch in Key_Shared mode.
Partition key Will be used if ordering key not specified
Get the partition key for this message
@return key string that is hashed to determine message’s topic partition
Return the properties attached to the message.
Properties are application defined key/value pairs that will be attached to the message
Get the value of a specific property
Get the UTC based timestamp in milliseconds referring to when the message was published by the client
producer
Check whether the message has a specific property attached.
Deserialize a message id from a binary string
MessageId representing the “earliest” or “oldest available” message stored in the topic
MessageId representing the “latest” or “last published” message in the topic
Serialize the message id into a binary string for storing
Set content of the message to a buffer already allocated by the caller. No copies of
this buffer will be made. The caller is responsible to ensure the memory buffer is
valid until the message has been persisted (or an error is returned).
Builder
Specify a delay for the delivery of the messages.
Specify the this message should not be delivered earlier than the
specified timestamp.
Set the event timestamp for the message.
Sets the ordering key of the message for message dispatch in Key_Shared mode.
@param the ordering key for the message
set partition key for the message routing
@param hash of this key is used to determine message’s topic partition
override namespace replication clusters. note that it is the
caller’s responsibility to provide valid cluster names, and that
all clusters have been previously configured as topics.
Specify a custom sequence id for the message being published.
Close the producer and release resources allocated.
Close the producer and release resources allocated.
@return the maximum number of pending messages allowed across all the partitions
Set the number of max pending messages across all the partitions
Get the last sequence id that was published by this producer.
@return the producer name which could have been assigned by the system or specified by the client
@return the topic to which producer is publishing to
Publish a message on the topic associated with this Producer.
Asynchronously publish a message on the topic associated with this Producer.
A message listener enables your application to configure how to process
messages. A listener will be called in order for every message received.
Sets the size of the reader receive queue.
@return the topic this reader is reading from
Read a single message.
Read a single message