queue

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 0 Imported by: 0

README

消息队列

  • RocketMQ
  • RabbitMQ
  • Kafka
  • Nats

作用

  • 系统解耦
  • 异步处理
  • 削峰填谷

客户端

如果是阿里云RocketMQ: 可以使用官方自己出的库

注意事项

  • Consumer 因可能多次收到同一消息,需要做好幂等处理
  • 消费时记录日志,方便后续定位问题,最好加上请求的唯一标识,比如 request_id或trace_id之类的字段
  • 尽量使用批量方式消费,可以很大程度上提高消费吞吐量

Reference

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Consume() error
}

Consumer queue consumer

type Producer

type Producer interface {
	Publish(message string) error
}

Producer queue producer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL