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

Pulsar Admin: expose the compression algoritm for "peek messages" #22629

Open
1 of 2 tasks
eolivelli opened this issue May 1, 2024 · 1 comment
Open
1 of 2 tasks

Pulsar Admin: expose the compression algoritm for "peek messages" #22629

eolivelli opened this issue May 1, 2024 · 1 comment
Assignees
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@eolivelli
Copy link
Contributor

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

When troubleshooting production enviroments it would be helpful to see with "peek message" the algorithm used for compression

Solution

Dump the value when prossing the peek messages command

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@eolivelli eolivelli added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label May 1, 2024
@dao-jun dao-jun self-assigned this May 2, 2024
@dao-jun
Copy link
Member

dao-jun commented May 2, 2024

It looks PersistentTopics already exposed CompressType of the message, but Message API didn't expose the method of getting compressType.
Maybe we need a PIP for the issue, or cast Message<byte[]> to MessageImpl:

List<Message<byte[]>> messages = admin.topics.peekMessages("topic", "sub", 10);
for (Message<byte[]> msg : messages) {
    MessageImpl<byte[]> impl = (MessageImpl<byte[]>) msg;
    MessageMetadata metadata = impl.getMessageBuilder();
   System.out.println(metadata.getCompressType());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

No branches or pull requests

2 participants