mq

package
v0.0.0-...-afaa79b Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exchange

type Exchange struct {
	Name string
}

type QueueConfig

type QueueConfig struct {
	Name       string
	RoutingKey string
	Durable    bool
	Exchanges  []Exchange
}

type RabbitConfig

type RabbitConfig struct {
	URL            string
	ReconnectDelay time.Duration
	Queues         map[string]QueueConfig // Map of queues by name
}

Configuration for RabbitMQ connection

func SetupRabbitMQConfig

func SetupRabbitMQConfig() RabbitConfig

func (*RabbitConfig) GetAllExchanges

func (r *RabbitConfig) GetAllExchanges() []Exchange

type RabbitMQProducer

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

RabbitMQProducer manages the connection and publishing to RabbitMQ

func NewRabbitMQProducer

func NewRabbitMQProducer(config RabbitConfig) *RabbitMQProducer

NewRabbitMQProducer creates a new producer instance

func (*RabbitMQProducer) Close

func (p *RabbitMQProducer) Close()

Close cleanly closes the channel and connection

func (*RabbitMQProducer) Run

func (p *RabbitMQProducer) Run()

Run starts the connection and the publishing process

func (*RabbitMQProducer) SendMessage

func (p *RabbitMQProducer) SendMessage(exchangeName, queueName, message string)

sendMessage sends a message to a specified queue

Jump to

Keyboard shortcuts

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