rabbitmq

package
v0.0.0-...-069db6f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KIND_FANOUT = "fanout"
)

Variables

This section is empty.

Functions

func CreateExchange

func CreateExchange(exchangeName string, kind string, conn *amqp.Connection) error

创建exchange交换机

func CreateQueueWithEx

func CreateQueueWithEx(queueName string, exchangeName string, routingKey string, conn *amqp.Connection) error

创建队列并与exchange绑定

func Receive

func Receive(handler func(msg string), queueName string, conn *amqp.Connection) error

func SendMsg

func SendMsg(msg string, exchangeName string, routingKey string, conn *amqp.Connection) error

发送mq消息

Types

type ConfigRabbitMQ

type ConfigRabbitMQ struct {
	Address string
	Timeout int64
}

func StdConfig

func StdConfig() ConfigRabbitMQ

标准配置

func (ConfigRabbitMQ) Build

func (stdConfig ConfigRabbitMQ) Build() (*amqp.Connection, error)

创建 mq 连接

Jump to

Keyboard shortcuts

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