rabbitmq

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) func(ctx context.Context) error

New creates new RabbitMQ health check that verifies the following: - connection establishing - getting channel from the connection - declaring topic exchange - declaring queue - binding a queue to the exchange with the defined routing key - publishing a message to the exchange with the defined routing key - consuming published message

Types

type Config

type Config struct {
	// DSN is the RabbitMQ instance connection DSN. Required.
	DSN string
	// Exchange is the application health check exchange. If not set - "health_check" is used.
	Exchange string
	// RoutingKey is the application health check routing key within health check exchange.
	// Can be an application or host name, for example.
	// If not set - host name is used.
	RoutingKey string
	// Queue is the application health check queue, that binds to the exchange with the routing key.
	// If not set - "<exchange>.<routing-key>" is used.
	Queue string
	// ConsumeTimeout is the duration that health check will try to consume published test message.
	// If not set - 3 seconds
	ConsumeTimeout time.Duration
	// DialTimeout is the duration that health check will try to dial to RabbitMQ.
	// If not set - 200 milliseconds.
	DialTimeout time.Duration
}

Config is the RabbitMQ checker configuration settings container.

Jump to

Keyboard shortcuts

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