cfrabbit

package module
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 5 Imported by: 0

README

CF Rabbit

CF Rabbit is a module that wraps interacting with a RabbitMQ (RMQ) server through Cloud Foundry (CF). It takes care of reconnecting in the background.

It's an adaptation from the AMQP Example for a CF environment

Dev mode

CF Rabbit identifiers the environment it runs in. If no CF environment variables are available then it assumes it's running in local dev mode.

If you want to run it in dev mode then make sure the following environment variables are available:

  • DEV_SERVER_NAME (localhost if running a local RMQ)
  • DEV_RMQ_URL (full RMQ connection string)

TLS verification is disabled in dev mode

How to use

NewConsumer(queueName string, routingkeys []string, exchange string) (<-chan amqp.Delivery, error) NewPublisher(exchangeName, exchangeType string) (*Publisher, error)

Credits

Thanks go out to creators and maintainers of these modules:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndBindQueue added in v0.1.5

func CreateAndBindQueue(exchangeName, exchangeType, queueName string, routingkeys []string) error

func UnbindQueue added in v0.1.7

func UnbindQueue(queueName, key, exchange string) error

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

func New

func New() *Session

func (*Session) Close

func (s *Session) Close() error

Close will cleanly shutdown the channel and connection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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