本质上就是主题所说的内容。
我想知道 JetStream 是否可以通过某种方式进行查询,允许我们重新获取主题“foo.*”的最后 15 条消息,或者 JetStream 在过去 1.5 秒内收到的关于主题“foo.*”的消息.
如果可能的话,我们将不胜感激任何代码示例或代码示例链接。
最佳答案
据官方docs
- 可以从特定时间开始抓取消息:最后 1.5 秒内。
DeliverByStartTime
When first consuming messages, start with messages on or after this time. The consumer is required to specify OptStartTime, the time in the stream to start at. It will receive the closest available message on or after that time.
- 另一个要求,最后15条消息,我认为不可能
关于go - NATS JetStream : Is it possible to explicitly ask from JetStream to (re)send the last few messages it received in subject foo. *?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70776767/