我正在尝试使用 nats 消息服务发送文件。文件的大小可能会有所不同。有没有办法在消息正文中发送超过 1MB 的数据,或者可能中断并加入消息正文?
最佳答案
2022-09-19 更新
根据文档 ( https://docs.nats.io/reference/faq#is-there-a-message-size-limitation-in-nats ),默认大小为 1M,最多可增加到 64M。 (另请参阅其他答案)
过时的信息
根据 NATS FAQ,您不能发送大小超过 1M 的消息 (https://docs.nats.io/reference/faq#is-there-a-message-size-limitation-in-nats):
NATS does have a message size limitation that is enforced by the server and communicated to the client during connection setup. Currently, the limit is 1MB.
消息系统不应该用于文件传输。使用分布式存储服务来保存文件并在消息中传递文件 ID。
关于go - 使用 nats-streaming 发送大于 1MB 的消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55368487/