mq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogExchange       = "ex.demo.log"
	AlternateExchange = "ex.alternate"
	DLXExchange       = "ex.dlx"
	LogQueue1         = "q.demo.log.1"
	LogQueue2         = "q.demo.log.2"
	AlternateQueue    = "q.alternate"
	DLXQueue          = "q.dlx"
	LogRK1            = "rk.demo.log.1"
	LogRK2            = "rk.demo.log.2"
	DLXRK             = "rk.dlx"
	AlternateRK       = "rk.alternate"
	LogConsumer       = "consumer.demo.log"
)

Variables

This section is empty.

Functions

func InitExchangeAndQueues

func InitExchangeAndQueues(producer *rabbitmq.Rabbit) error

func RunConsumer

func RunConsumer(consumer *rabbitmq.Rabbit)

func SendMessageConfirm

func SendMessageConfirm(msg *Message) error

SendMessageConfirm 使用生产者确认模式发送消息

func SendMessageTTL

func SendMessageTTL(msg *Message, ttlInMillis int) error

SendMessageTTL 发送TTL消息

func SendMessageTx

func SendMessageTx(msg *Message) error

SendMessageTx 使用事务模式发送消息,性能较低

Types

type Message

type Message struct {
	Id   string `json:"id"`
	Data any    `json:"data"`
}

Message demo message

Jump to

Keyboard shortcuts

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