Skip to content

Commit

Permalink
Feature/amqp single consumers (#373)
Browse files Browse the repository at this point in the history
* Use quorum queues instead of classic queues

* Configure amqp queue to use x-single-active-consumer to allow the server component to run in HA mode while still only handling one message at a time
  • Loading branch information
mahlunar authored Jun 16, 2022
1 parent 24787e8 commit 13734da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/amqp/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ func (w *Worker) initializeConsumer(c ConsumerConfig) error {

w.logger.Infof("[amqp] Declaring queue '%s'", prefixedQueue)
queueArgs := amqp.Table{
"x-queue-type": "quorum",
"x-queue-type": "quorum",
"x-single-active-consumer": true,
}
_, err = channel.QueueDeclare(
prefixedQueue, // name
Expand Down

0 comments on commit 13734da

Please sign in to comment.