apache / apache/pulsar-client-node
Compacted topic ... how to get the most recent message?
- Dominant language
- C++
- Stars
- 164
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
I am struggeling with reading from a compacted topic. How would I set up a consumer or a reader that receives the most recent message (published before starting up the client) on a compacted topic? I am only able to receive either all messages or none. I tried settting up the consumer with these options:
{
topic: "persistent://public/default/topic",
subscription: 'sub-1',
subscriptionType: 'Exclusive',
subscriptionInitialPosition: 'Earliest',
readCompacted: true,
}
{
topic: "persistent://public/default/topic",
subscription: 'sub-1',
subscriptionType: 'Exclusive',
subscriptionInitialPosition: 'Latest',
readCompacted: true,
}
...and for the reader:
{
topic: 'persistent://public/default/topic',
startMessageId: Pulsar.MessageId.latest(),
readCompacted: true
}
{
topic: 'persistent://public/default/topic',
startMessageId: Pulsar.MessageId.eariest(),
readCompacted: true
}
Am I missing something here?
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names consumer and reader configurations but no repository file or test. Start by reproducing both subscription positions and reader message IDs with readCompacted enabled, then compare the behavior with compacted-topic semantics. Done means determining whether the requested latest-message behavior is supported and documenting the required configuration or a concrete defect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100