接口的使用
org.apache.pulsar.client.api.MessageId
-
使用MessageId的程序包 程序包 说明 org.apache.pulsar.client.api Pulsar Client API.org.apache.pulsar.client.api.interceptor Pulsar interceptors.org.apache.pulsar.client.internal Helpers which provide useful functionality for the implementation of Pulsar Client API. -
-
org.apache.pulsar.client.api中MessageId的使用
声明为MessageId的org.apache.pulsar.client.api中的字段 修饰符和类型 字段 说明 static MessageIdMessageId. earliestMessageId that represents the oldest message available in the topic.static MessageIdMessageId. latestMessageId that represents the next message published in the topic.返回MessageId的org.apache.pulsar.client.api中的方法 修饰符和类型 方法 说明 static MessageIdMessageId. fromByteArray(byte[] data)De-serialize a message id from a byte array.static MessageIdMessageId. fromByteArrayWithTopic(byte[] data, java.lang.String topicName)De-serialize a message id from a byte array with its topic information attached.MessageIdConsumer. getLastMessageId()Get the last message id available for consume.MessageIdMessage. getMessageId()Get the unique message ID associated with this message.MessageIdProducer. send(T message)Sends a message.MessageIdTypedMessageBuilder. send()Send a message synchronously.返回变量类型为MessageId的类型的org.apache.pulsar.client.api中的方法 修饰符和类型 方法 说明 java.util.concurrent.CompletableFuture<MessageId>Consumer. getLastMessageIdAsync()Get the last message id available for consume.java.util.concurrent.CompletableFuture<MessageId>Producer. sendAsync(T message)Send a message asynchronously.java.util.concurrent.CompletableFuture<MessageId>TypedMessageBuilder. sendAsync()Send a message asynchronously参数类型为MessageId的org.apache.pulsar.client.api中的方法 修饰符和类型 方法 说明 voidConsumer. acknowledge(MessageId messageId)Acknowledge the consumption of a single message, identified by itsMessageId.java.util.concurrent.CompletableFuture<java.lang.Void>Consumer. acknowledgeAsync(MessageId messageId)Asynchronously acknowledge the consumption of a single message.java.util.concurrent.CompletableFuture<java.lang.Void>Consumer. acknowledgeAsync(MessageId messageId, Transaction txn)Asynchronously acknowledge the consumption of a single message, it will store in pending ack.voidConsumer. acknowledgeCumulative(MessageId messageId)Acknowledge the reception of all the messages in the stream up to (and including) the provided message.java.util.concurrent.CompletableFuture<java.lang.Void>Consumer. acknowledgeCumulativeAsync(MessageId messageId)Asynchronously Acknowledge the reception of all the messages in the stream up to (and including) the provided message.java.util.concurrent.CompletableFuture<java.lang.Void>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.voidConsumer. negativeAcknowledge(MessageId messageId)Acknowledge the failure to process a single message.voidConsumerInterceptor. onAcknowledge(Consumer<T> consumer, MessageId messageId, java.lang.Throwable exception)This is called consumer sends the acknowledgment to the broker.voidConsumerInterceptor. onAcknowledgeCumulative(Consumer<T> consumer, MessageId messageId, java.lang.Throwable exception)This is called consumer send the cumulative acknowledgment to the broker.voidProducerInterceptor. onSendAcknowledgement(Producer<T> producer, Message<T> message, MessageId msgId, java.lang.Throwable exception)已过时。This method is called when the message sent to the broker has been acknowledged, or when sending the message fails.voidConsumer. seek(MessageId messageId)Reset the subscription associated with this consumer to a specific message id.voidReader. seek(MessageId messageId)Reset the subscription associated with this reader to a specific message id.java.util.concurrent.CompletableFuture<java.lang.Void>Consumer. seekAsync(MessageId messageId)Reset the subscription associated with this consumer to a specific message id.java.util.concurrent.CompletableFuture<java.lang.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.类型变量类型为MessageId的org.apache.pulsar.client.api中的方法参数 修饰符和类型 方法 说明 voidConsumer. acknowledge(java.util.List<MessageId> messageIdList)Acknowledge the consumption of a list of message.java.util.concurrent.CompletableFuture<java.lang.Void>Consumer. acknowledgeAsync(java.util.List<MessageId> messageIdList)Asynchronously acknowledge the consumption of a list of message.voidConsumerInterceptor. onAckTimeoutSend(Consumer<T> consumer, java.util.Set<MessageId> messageIds)This method will be called when a redelivery from an acknowledge timeout occurs.voidConsumerInterceptor. onNegativeAcksSend(Consumer<T> consumer, java.util.Set<MessageId> messageIds)This method will be called when a redelivery from a negative acknowledge occurs. -
org.apache.pulsar.client.api.interceptor中MessageId的使用
参数类型为MessageId的org.apache.pulsar.client.api.interceptor中的方法 修饰符和类型 方法 说明 voidProducerInterceptor. onSendAcknowledgement(Producer producer, Message message, MessageId msgId, java.lang.Throwable exception)This method is called when the message sent to the broker has been acknowledged, or when sending the message fails.voidProducerInterceptorWrapper. onSendAcknowledgement(Producer producer, Message message, MessageId msgId, java.lang.Throwable exception) -
org.apache.pulsar.client.internal中MessageId的使用
返回MessageId的org.apache.pulsar.client.internal中的方法 修饰符和类型 方法 说明 static MessageIdDefaultImplementation. newMessageId(long ledgerId, long entryId, int partitionIndex)static MessageIdDefaultImplementation. newMessageIdFromByteArray(byte[] data)static MessageIdDefaultImplementation. newMessageIdFromByteArrayWithTopic(byte[] data, java.lang.String topicName)
-