接口的使用
org.apache.pulsar.client.api.MessageId
使用MessageId的程序包
程序包
说明
Pulsar Client API.
Pulsar interceptors.
Helpers which provide useful functionality for the implementation of Pulsar Client API.
-
org.apache.pulsar.client.api中MessageId的使用
修饰符和类型字段说明static final MessageId
MessageId.earliest
MessageId that represents the oldest message available in the topic.static final 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.Consumer.getLastMessageId()
Get the last message id available for consume.Message.getMessageId()
Get the unique message ID associated with this message.Sends a message.TypedMessageBuilder.send()
Send a message synchronously.返回变量类型为MessageId的类型的org.apache.pulsar.client.api中的方法修饰符和类型方法说明Consumer.getLastMessageIdAsync()
Get the last message id available for consume.Send a message asynchronously.TypedMessageBuilder.sendAsync()
Send a message asynchronously参数类型为MessageId的org.apache.pulsar.client.api中的方法修饰符和类型方法说明void
Consumer.acknowledge
(MessageId messageId) Acknowledge the consumption of a single message, identified by itsMessageId
.Consumer.acknowledgeAsync
(MessageId messageId) Asynchronously acknowledge the consumption of a single message.Consumer.acknowledgeAsync
(MessageId messageId, Transaction txn) Asynchronously acknowledge the consumption of a single message, it will store in pending ack.void
Consumer.acknowledgeCumulative
(MessageId messageId) Acknowledge the reception of all the messages in the stream up to (and including) the provided message.Consumer.acknowledgeCumulativeAsync
(MessageId messageId) Asynchronously Acknowledge the reception of all the messages in the stream up to (and including) the provided message.Consumer.acknowledgeCumulativeAsync
(MessageId messageId, Transaction txn) Acknowledge the reception of all the messages in the stream up to (and including) the provided message with this transaction, it will store in transaction pending ack.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
Reset the subscription associated with this consumer to a specific message id.void
Reset the subscription associated with this reader to a specific message id.Reset the subscription associated with this consumer to a specific message id.Reset the subscription associated with this reader to a specific message id.ReaderBuilder.startMessageId
(MessageId startMessageId) The initial reader positioning is done by specifying a message id.类型变量类型为MessageId的org.apache.pulsar.client.api中的方法参数修饰符和类型方法说明void
Consumer.acknowledge
(List<MessageId> messageIdList) Acknowledge the consumption of a list of message.Consumer.acknowledgeAsync
(List<MessageId> messageIdList) Asynchronously acknowledge the consumption of a list of message.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. -
org.apache.pulsar.client.api.interceptor中MessageId的使用
修饰符和类型方法说明void
ProducerInterceptor.onSendAcknowledgement
(Producer producer, Message 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
ProducerInterceptorWrapper.onSendAcknowledgement
(Producer producer, Message message, MessageId msgId, Throwable exception) -
org.apache.pulsar.client.internal中MessageId的使用
修饰符和类型方法说明PulsarClientImplementationBinding.newMessageId
(long ledgerId, long entryId, int partitionIndex) PulsarClientImplementationBinding.newMessageIdFromByteArray
(byte[] data) PulsarClientImplementationBinding.newMessageIdFromByteArrayWithTopic
(byte[] data, String topicName)