humq

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MQURL = "amqp://guest:guest@106.52.150.139:5672/"

const MQURL = "amqp://toor:root@106.52.150.139:5672/"

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitMQ

type RabbitMQ struct {

	//队列名称
	QueueName string
	//交换机
	Exchange string
	//key Simple模式 几乎用不到
	Key string
	//连接信息
	Mqurl string
	// contains filtered or unexported fields
}

func NewRabbitMQ

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

创建RabbitMQ结构体实例

func NewRabbitMQPubSub

func NewRabbitMQPubSub(exchangeName string) *RabbitMQ

订阅模式创建rabbitmq实例

func NewRabbitMQRouting

func NewRabbitMQRouting(exchagne string, routingKey string) *RabbitMQ

路由模式 创建RabbitMQ实例

func NewRabbitMQSimple

func NewRabbitMQSimple(queueName string) *RabbitMQ

简单模式step:1。创建简单模式下RabbitMQ实例

func NewRabbitMQTopic

func NewRabbitMQTopic(exchagne string, routingKey string) *RabbitMQ

话题模式 创建RabbitMQ实例

func (*RabbitMQ) ConsumeSimple

func (r *RabbitMQ) ConsumeSimple()

简单模式消费

func (*RabbitMQ) Destory

func (r *RabbitMQ) Destory()

断开channel和connection

func (*RabbitMQ) PublishPub

func (r *RabbitMQ) PublishPub(message string)

订阅模式生产

func (*RabbitMQ) PublishRouting

func (r *RabbitMQ) PublishRouting(message string)

路由模式发送信息

func (*RabbitMQ) PublishSimple

func (r *RabbitMQ) PublishSimple(message string)

简单模式生产

func (*RabbitMQ) PublishTopic

func (r *RabbitMQ) PublishTopic(message string)

话题模式发送信息

func (*RabbitMQ) RecieveRouting

func (r *RabbitMQ) RecieveRouting()

路由模式接收信息

func (*RabbitMQ) RecieveSub

func (r *RabbitMQ) RecieveSub()

订阅模式消费端代码

func (*RabbitMQ) RecieveTopic

func (r *RabbitMQ) RecieveTopic()

话题模式接收信息 要注意key 其中* 用于匹配一个单词,#用于匹配多个单词(可以是零个) 匹配 表示匹配imooc.* 表示匹配imooc.hello,但是imooc.hello.one需要用imooc.#才能匹配到

Jump to

Keyboard shortcuts

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