rabbitmq

package
v3.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) func() 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
	// LogFunc is the callback function for errors logging during check.
	// If not set logging is skipped.
	LogFunc func(err error, details string, extra ...interface{})
}

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