rabbitmq

package
v0.0.0-...-b262f20 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const LOG_FIELD = "[RABBITMQ]"

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitConfig

type RabbitConfig struct {
	Dsn        string     //队列地址
	QueueName  string     //队列名
	ExChange   string     //交换机名称
	Key        string     //绑定的key名称
	Durable    bool       //是否持久化
	AutoDelete bool       //是否自动删除
	Exclusive  bool       //是否具有排他性
	NoWait     bool       //是否阻塞处理
	Args       amqp.Table //额外的属性

	Consumer string //指定消费者
	AutoAck  bool   //是否自动应答,告诉我已经消费完了
	NoLocal  bool   //若设置为true,则表示为不能将同一个connection中发送的消息传递给这个connection中的消费者
}

type RabbitMQ

type RabbitMQ struct {
	Payload chan []byte //拿到的数据
	// contains filtered or unexported fields
}

RabbitMQ结构体

func NewRabbitMQ

func NewRabbitMQ(config RabbitConfig) (rabbitmq *RabbitMQ)

func (*RabbitMQ) Connect

func (r *RabbitMQ) Connect()

func (*RabbitMQ) ConsumeSimple

func (r *RabbitMQ) ConsumeSimple()

func (*RabbitMQ) Destory

func (r *RabbitMQ) Destory()

关闭

func (*RabbitMQ) PublishSimple

func (r *RabbitMQ) PublishSimple(message []byte) (err error)

直接模式,生产者.

Jump to

Keyboard shortcuts

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