package
Version:
v1.9.0
Opens a new window with list of versions in this module.
Published: Aug 11, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
消息队列
- RocketMQ
- RabbitMQ
- Kafka
- Nats
作用
客户端
如果是阿里云RocketMQ: 可以使用官方自己出的库
注意事项
- Consumer 因可能多次收到同一消息,需要做好幂等处理
- 消费时记录日志,方便后续定位问题,最好加上请求的唯一标识,比如 request_id或trace_id之类的字段
- 尽量使用批量方式消费,可以很大程度上提高消费吞吐量
Reference
Documentation
¶
type Consumer interface {
Consume() error
}
Consumer queue consumer
type Producer interface {
Publish(message string) error
}
Producer queue producer
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.