simple

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer added in v1.0.2

type Consumer struct {
	// contains filtered or unexported fields
}

func NewSimpleConsumer

func NewSimpleConsumer(url, exchangeName, queueName string, chanNumber int) (*Consumer, error)

NewSimpleConsumer 创建一个新的 Consumer 实例 url 示例: amqp://user:password@addr:5672/

func (*Consumer) Declare added in v1.3.0

func (c *Consumer) Declare()

Declare 队列绑定

func (*Consumer) Destroy added in v1.0.2

func (c *Consumer) Destroy()

func (*Consumer) OnConnectionErrorReConnection added in v1.0.2

func (c *Consumer) OnConnectionErrorReConnection()

OnConnectionErrorReConnection 连接错误,自动重连

func (*Consumer) Received added in v1.0.2

func (c *Consumer) Received(autoAck bool, handler func(receiveData, objectType string) error)

Received 通过回调函数处理接收到的消息

type Producer added in v1.0.2

type Producer struct {
	// contains filtered or unexported fields
}

func NewSimpleProducer

func NewSimpleProducer(url, exchangeName, queueName string) (*Producer, error)

NewSimpleProducer 创建一个新的 Producer 实例

func (*Producer) Close added in v1.0.2

func (p *Producer) Close()

Close 手动关闭连接

func (*Producer) OnConnectionErrorReConnection added in v1.0.2

func (p *Producer) OnConnectionErrorReConnection()

OnConnectionErrorReConnection 监听连接错误,自动重连

func (*Producer) Send added in v1.0.2

func (p *Producer) Send(data, routeKey, expire, objectType string) error

Send 发送数据,channel 复用

Jump to

Keyboard shortcuts

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