Categorygithub.com/krixlion/dev_forum-rabbitmq
modulepackage
0.0.0-20241023212113-521c9edc59c5
Repository: https://github.com/krixlion/dev_forum-rabbitmq.git
Documentation: pkg.go.dev

# README

Status

This library has been migrated to dev_forum-lib. This repository is archived and no longer maintained.

dev-forum_rabbitmq

GoDoc Go Report Card GitHub License

RabbitMQ library made on top of rabbitmq/amqp091-go for dev-forum project.

Usage

NewRabbitMQ returns a new initialized connection struct. It will manage the active connection in the background. Connection should be closed in order to shut it down gracefully.

func example() {
	user := "guest"
	pass := "guest"
	host := "localhost"
	port := "5672"
	consumer := "user-service" //  Unique name for each consumer used to sign messages.

	// You can specify your own config or use DefaultConfig() instead.
	config := Config{
		QueueSize:         100,
		MaxWorkers:        50,
		ReconnectInterval: time.Second * 2,
		MaxRequests:       5,
		ClearInterval:     time.Second * 5,
		ClosedTimeout:     time.Second * 5,
	}

	// Logger and tracer are optional.
	rabbit := rabbitmq.NewRabbitMQ(consumer, user, pass, host, port, config, WithLogger(customLogger))
	defer rabbit.Close()
}

# Functions

No description provided by the author
ExtractAMQPHeaders extracts the trace data from the header and puts it into the returned context.
NewRabbitMQ returns a new initialized connection struct.
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author