Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute Consumer#getLastMessageId when setting brokerEntryMetadataInterceptors #10950

Closed
wuzhanpeng opened this issue Jun 17, 2021 · 0 comments · Fixed by #10968
Closed
Assignees
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@wuzhanpeng
Copy link
Contributor

wuzhanpeng commented Jun 17, 2021

Describe the bug
After setting brokerEntryMetadataInterceptors parameters in conf/broker.conf, we found that we cannot invoke method org.apache.pulsar.client.api.Consumer#getLastMessageId normally. At the same time, the log also prompted that an exception occurred during metadata parsing.

To Reproduce
Steps to reproduce the behavior:

  1. set parameters in conf/broker.conf as we used in KoP
# refer to https://github.com/streamnative/kop/blob/master/docs/kop.md
brokerEntryMetadataInterceptors=org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor,org.apache.pulsar.common.intercept.AppendBrokerTimestampMetadataInterceptor
  1. execute a program like:
admin.topics().createNonPartitionedTopic(topic);
Producer<String> producer = pulsarClient.newProducer(Schema.STRING)
        .topic(topic)
        .create();
producer.newMessage().key("k1").value("mm").send();

Consumer<String> consumer = pulsarClient.newConsumer(Schema.STRING)
        .topic(topic)
        .subscriptionName(group)
        .subscribe();
consumer.getLastMessageId();

Expected behavior
Able to correctly execute Consumer#getLastMessageId in this scenario.

Screenshots

org.apache.pulsar.client.api.PulsarClientException$BrokerMetadataException: 
The subscription XXX of the topic YYY gets the last message id was failed
Failed to get batch size for entry java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6
        at org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:987)
        at org.apache.pulsar.client.impl.ConsumerBase.getLastMessageId(ConsumerBase.java:606)

Additional context
I can help submit a PR later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
2 participants