rabbitmq

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package rabbitmq holds the implementation of the Publisher and PubSub interfaces for the RabbitMQ messaging system, the internal messaging broker of the Magistrala IoT platform. Due to the practical requirements implementation Publisher is created alongside PubSub. The reason for this is that Subscriber implementation of RabbitMQ brings the burden of additional struct fields which are not used by Publisher. Subscriber is not implemented separately because PubSub can be used where Subscriber is needed.

Index

Constants

View Source
const (
	// SubjectAllChannels represents subject to subscribe for all the channels.
	SubjectAllChannels = "channels.#"
)

Variables

View Source
var (
	// ErrNotSubscribed indicates that the topic is not subscribed to.
	ErrNotSubscribed = errors.New("not subscribed")

	// ErrEmptyTopic indicates the absence of topic.
	ErrEmptyTopic = errors.New("empty topic")

	// ErrEmptyID indicates the absence of ID.
	ErrEmptyID = errors.New("empty ID")
)
View Source
var ErrInvalidType = errors.New("invalid type")

ErrInvalidType is returned when the provided value is not of the expected type.

Functions

func Channel

func Channel(channel *amqp.Channel) messaging.Option

Channel sets the channel for the publisher or subscriber.

func Exchange

func Exchange(exchange string) messaging.Option

Exchange sets the exchange for the publisher or subscriber.

func NewPubSub

func NewPubSub(url string, logger *slog.Logger, opts ...messaging.Option) (messaging.PubSub, error)

NewPubSub returns RabbitMQ message publisher/subscriber.

func NewPublisher

func NewPublisher(url string, opts ...messaging.Option) (messaging.Publisher, error)

NewPublisher returns RabbitMQ message Publisher.

func Prefix

func Prefix(prefix string) messaging.Option

Prefix sets the prefix for the publisher.

Types

This section is empty.

Directories

Path Synopsis
Package tracing provides tracing instrumentation for Magistrala things policies service.
Package tracing provides tracing instrumentation for Magistrala things policies service.

Jump to

Keyboard shortcuts

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