go - NATS JetStream : Is it possible to explicitly ask from JetStream to (re)send the last few messages it received in subject foo. *?

标签 go messaging nats.io event-stream nats-jetstream

本质上就是主题所说的内容。

我想知道 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/

相关文章:

go - channel slice 和并发函数执行

go - 使用自定义处理程序 nats golang 保留订阅方法

python-3.x - 从 Kubernetes 事件中调试 NATS 消息

go - 你如何在 Go 中表达一个 "null"值?

go - "Block"型模板函数

go - 如何使用 bson.SetBSON 或 bson.Raw?

ios - QuickBlox 不发送消息非常奇怪的行为

java - 如何从 Java Web 应用程序发送 SMS 消息

.net - 长时间运行的 MSMQ 消息处理。限制工作线程数

linux - 如何在不停止流媒体服务器的情况下热重载 NATS 流媒体服务器?