julyday2015 opened a new issue #12962:
URL: https://github.com/apache/pulsar/issues/12962
**Describe the bug**
Hi, I found an issue in java client library. When consumer tried to
acknowledge, if consumer acknowledge like following, its working:
`consumer.acknowledge(message.getMessageId())`
But if I do following, it’s failed:
`consumer.acknowledge(MessageId.fromByteArray(message.getMessageId().toByteArray()))`
Ideally, both of the cases should work. There should be something wrong with
serialization and deserialization of MessageId’s toByteArray and fromByteArray
method.
An exception will be thrown if I use second method for acknowledging:
`java.lang.IllegalArgumentException: null
at
org.apache.pulsar.shade.com.google.common.base.Preconditions.checkArgument(Preconditions.java:128)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.doAcknowledge(MultiTopicsConsumerImpl.java:425)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.doAcknowledgeWithTxn(ConsumerBase.java:554)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.acknowledgeAsync(ConsumerBase.java:494)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.acknowledgeAsync(ConsumerBase.java:483)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.acknowledge(ConsumerBase.java:313)
~[pulsar-client-2.8.1.jar:2.8.1]`
**To Reproduce**
Steps to reproduce the behavior:
1. Do consumer acknowledge with
`consumer.acknowledge(MessageId.fromByteArray(message.getMessageId().toByteArray()))`
2. Exception thrown:
`java.lang.IllegalArgumentException: null
at
org.apache.pulsar.shade.com.google.common.base.Preconditions.checkArgument(Preconditions.java:128)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.doAcknowledge(MultiTopicsConsumerImpl.java:425)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.doAcknowledgeWithTxn(ConsumerBase.java:554)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.acknowledgeAsync(ConsumerBase.java:494)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.acknowledgeAsync(ConsumerBase.java:483)
~[pulsar-client-2.8.1.jar:2.8.1]
at
org.apache.pulsar.client.impl.ConsumerBase.acknowledge(ConsumerBase.java:313)
~[pulsar-client-2.8.1.jar:2.8.1]`
**Expected behavior**
It should work like `consumer.acknowledge(message.getMessageId())`
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
**Additional context**
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]