connection

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	GetConn() *amqp.Connection
	GetChannel() *amqp.Channel
	SetReconnectHooks(...func())
}

func NewConnection

func NewConnection(options *Options) Connection

type Options

type Options struct {
	/*
		URI is the RabbitMQ connection string with format: "amqp://username:password@localhost:5672"
	*/
	URI string

	/*
		InitialBackoffInterval is the initial delay between reconnections.

		Each time the client reconnects, it waits for last(or initial) backoff interval * 2 until and
		this value increases (x2) on each retry until reach the max configured interval.

		Once the client successful reconnects the backoff interval is set back to the initial value.
	*/
	InitialBackoffInterval time.Duration

	/*
		MaxBackoffInterval is the max interval between reconnections.

		Each time the client reconnects, it waits for last(or initial) backoff interval * 2 until and
		this value increases (x2) on each retry until reach the max configured interval.

		Once the client successful reconnects the backoff interval is set back to the initial value.
	*/
	MaxBackoffInterval time.Duration
}

Options contains the RabbitMQ connection and reconnection params

Jump to

Keyboard shortcuts

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