-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
lifecycle/staletype/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug
Description
Case 1. After receiving the message from Pulsar consumer, just calling the consumer.acknowledge() immediately, this message can be acknowledged successfully. Here's the code
consumer.receiveAsync().thenAccept(msg -> {
consumer.acknowledge(msg.getMessageId());
....
}
Case 2. If I calling the toByteArray & fromByteArrayWithTopic functions, the message just can't be acknowledged successfully.
consumer.receiveAsync().thenAccept(msg -> {
MessageId msgId = MessageId.fromByteArrayWithTopic(msg.getMessageId().toByteArray(), topic.toString());
consumer.acknowledgeAsync(msgId);
....
}
Case 3. If I calling the toByteArray & fromByteArray functions, the message just still can't be acknowledged successfully.
consumer.receiveAsync().thenAccept(msg -> {
MessageId msgId = MessageId.fromByteArray(msg.getMessageId().toByteArray());
consumer.acknowledgeAsync(msgId);
....
}
Case 4. Still failed
consumer.receiveAsync().thenAccept(msg -> {
String messageId = Base64.getEncoder().encodeToString(msg.getMessageId().toByteArray());
MessageId msgId = MessageId.fromByteArrayWithTopic(Base64.getDecoder().decode(messageId), topic.toString());
consumer.acknowledgeAsync(msgId);
....
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lifecycle/staletype/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug