程序包 | 说明 |
---|---|
org.apache.pulsar.client.api | |
org.apache.pulsar.client.internal |
限定符和类型 | 字段和说明 |
---|---|
static MessageId |
MessageId.earliest
MessageId that represents the oldest message available in the topic
|
static MessageId |
MessageId.latest
MessageId that represents the next message published in the topic
|
限定符和类型 | 方法和说明 |
---|---|
static MessageId |
MessageId.fromByteArray(byte[] data)
De-serialize a message id from a byte array
|
static MessageId |
MessageId.fromByteArrayWithTopic(byte[] data,
String topicName)
De-serialize a message id from a byte array with its topic
information attached.
|
MessageId |
Message.getMessageId()
Get the unique message ID associated with this message.
|
MessageId |
TypedMessageBuilder.send()
Send a message synchronously.
|
MessageId |
Producer.send(T message)
Sends a message.
|
限定符和类型 | 方法和说明 |
---|---|
CompletableFuture<MessageId> |
TypedMessageBuilder.sendAsync()
Send a message asynchronously
This method returns a future that can be used to track the completion of the send operation and yields the
MessageId assigned by the broker to the published message. |
CompletableFuture<MessageId> |
Producer.sendAsync(T message)
Send a message asynchronously
When the producer queue is full, by default this method will complete the future with an exception
PulsarClientException.ProducerQueueIsFullError
See ProducerBuilder.maxPendingMessages(int) to configure the producer queue size and
ProducerBuilder.blockIfQueueFull(boolean) to change the blocking behavior. |
限定符和类型 | 方法和说明 |
---|---|
void |
Consumer.acknowledge(MessageId messageId)
Acknowledge the consumption of a single message, identified by its
MessageId . |
CompletableFuture<Void> |
Consumer.acknowledgeAsync(MessageId messageId)
Asynchronously acknowledge the consumption of a single message
|
void |
Consumer.acknowledgeCumulative(MessageId messageId)
Acknowledge the reception of all the messages in the stream up to (and including) the provided message.
|
CompletableFuture<Void> |
Consumer.acknowledgeCumulativeAsync(MessageId messageId)
Asynchronously Acknowledge the reception of all the messages in the stream up to (and including) the provided
message.
|
void |
Consumer.negativeAcknowledge(MessageId messageId)
Acknowledge the failure to process a single message.
|
void |
ConsumerInterceptor.onAcknowledge(Consumer<T> consumer,
MessageId messageId,
Throwable exception)
This is called consumer sends the acknowledgment to the broker.
|
void |
ConsumerInterceptor.onAcknowledgeCumulative(Consumer<T> consumer,
MessageId messageId,
Throwable exception)
This is called consumer send the cumulative acknowledgment to the broker.
|
void |
ProducerInterceptor.onSendAcknowledgement(Producer<T> producer,
Message<T> message,
MessageId msgId,
Throwable exception)
This method is called when the message sent to the broker has been
acknowledged, or when sending the message fails.
|
void |
Consumer.seek(MessageId messageId)
Reset the subscription associated with this consumer to a specific message id.
|
void |
Reader.seek(MessageId messageId)
Reset the subscription associated with this reader to a specific message id.
|
CompletableFuture<Void> |
Consumer.seekAsync(MessageId messageId)
Reset the subscription associated with this consumer to a specific message id.
|
CompletableFuture<Void> |
Reader.seekAsync(MessageId messageId)
Reset the subscription associated with this reader to a specific message id.
|
ReaderBuilder<T> |
ReaderBuilder.startMessageId(MessageId startMessageId)
The initial reader positioning is done by specifying a message id.
|
限定符和类型 | 方法和说明 |
---|---|
void |
ConsumerInterceptor.onAckTimeoutSend(Consumer<T> consumer,
Set<MessageId> messageIds)
This method will be called when a redelivery from an acknowledge timeout occurs.
|
void |
ConsumerInterceptor.onNegativeAcksSend(Consumer<T> consumer,
Set<MessageId> messageIds)
This method will be called when a redelivery from a negative acknowledge occurs.
|
限定符和类型 | 方法和说明 |
---|---|
static MessageId |
DefaultImplementation.newMessageId(long ledgerId,
long entryId,
int partitionIndex) |
static MessageId |
DefaultImplementation.newMessageIdFromByteArray(byte[] data) |
static MessageId |
DefaultImplementation.newMessageIdFromByteArrayWithTopic(byte[] data,
String topicName) |
Copyright © 2017–2019 Apache Software Foundation. All rights reserved.