rabbitmq

package
v0.0.0-...-a2093d6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MQURL = "amqp://flashsale:flashsale@127.0.0.1:5672/flashsale"

连接信息 const MQURL = "amqp://imoocuser:imoocuser@172.31.96.59:5672/imooc"

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitMQ

type RabbitMQ struct {

	//队列名称
	QueueName string
	//交换机名称
	Exchange string
	//bind Key 名称
	Key string
	//连接信息
	Mqurl string
	sync.Mutex
	// contains filtered or unexported fields
}

rabbitMQ结构体

func NewRabbitMQ

func NewRabbitMQ(queueName string, exchange string, key string) *RabbitMQ

创建结构体实例

func NewRabbitMQSimple

func NewRabbitMQSimple(queueName string) *RabbitMQ

创建简单模式下RabbitMQ实例

func (*RabbitMQ) ConsumeSimple

func (r *RabbitMQ) ConsumeSimple()

simple 模式下消费者

func (*RabbitMQ) Destory

func (r *RabbitMQ) Destory()

断开channel 和 connection

func (*RabbitMQ) PublishSimple

func (r *RabbitMQ) PublishSimple(message string) error

直接模式队列生产

Jump to

Keyboard shortcuts

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