Skip to content

Golang AMQP reliable connection, publisher, consumer.

License

Notifications You must be signed in to change notification settings

makasim/amqpextra

Repository files navigation

Extra features for streadway/amqp package.

Build Status

Documentation

Dialer.

Provides:

  • Auto reconnect.
  • Context aware.
  • Configured by WithXXX options.
  • Dial multiple servers.
  • Notifies ready\unready\closed states.

Examples:

Consumer.

Provides:

  • Auto reconnect.
  • Context aware.
  • Configured by WithXXX options.
  • Consumer can process messages in parallel.
  • Consumers in-process auto-scaling and backpressure.
  • Adds message context.
  • Detects queue deletion and reconnect.
  • Notifies ready\unready\closed states.

Examples:

Publisher.

Provides:

  • Auto reconnect.
  • Context aware.
  • Configured by WithXXX options.
  • Notifies ready\unready\closed states.
  • Publish could wait till connection ready.
  • Adds message context.
  • Publish a message struct (define only what you need).
  • Supports flow control.

Examples:

Consumer middlewares

The consumer could chain middlewares for a preprocessing received message.

Here's some built-in middlewares:

  • HasCorrelationID - Nack message if has no correlation id
  • HasReplyTo - Nack message if has no reply to.
  • Logger - Context with logger.
  • Recover - Recover worker from panic, nack message.
  • Expire - Convert Message expiration to context with timeout.
  • AckNack - Return middleware.Ack to ack message.