简体   繁体   中英

How to list the messages of a nats jetstream and know if they were acknowledged?

I need to list the messages that were posted in nats stream to know which ones were not recognized.

I have tried to look at the admin api that nats suggests in its documentation, but it does not specify if this can be done or not.

I have also looked at the jetstream library for go , with this I can get general information about the streams and their comsumers but not the messages that were not acknowledged and I don't see any functions that give me what I need.

Has anyone already done this no matter the programming language?

Acknowledgements are tied to a specific consumer , not a stream .

You can derive the state of acknowledgements from consumer info, precisely, the Acknowledgement floor:

nats consumer info
State:

   Last Delivered Message: Consumer sequence: 8 Stream sequence: 158 Last delivery: 13m59s ago
     Acknowledgment floor: Consumer sequence: 4 Stream sequence: 154 Last Ack: 13m59s ago
         Outstanding Acks: 2 out of maximum 1,000
     Redelivered Messages: 0
     Unprocessed Messages: 42
            Waiting Pulls: 0 of maximum 512

Which is available in NATS CLI and most client libraries. There is no way to directly see the list of acknowledged messages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM