Skip to content

Commit

Permalink
applies x-max-priority if config value greater than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
markcsims committed Oct 21, 2024
1 parent ead44c3 commit d846fd8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package runamqp

import (
"fmt"
"sync"

"github.com/mergermarket/run-amqp/connection"
amqp "github.com/rabbitmq/amqp091-go"
"sync"
)

type consumerChannels struct {
Expand Down Expand Up @@ -126,7 +127,9 @@ func (c *Consumer) setUpMainExchangeWithQueue(amqpChannel *amqp.Channel) error {
}

args := make(map[string]interface{})
args["x-max-priority"] = c.config.queue.MaxPriority
if c.config.queue.MaxPriority > 0 {
args["x-max-priority"] = c.config.queue.MaxPriority
}

err = assertAndBindQueue(amqpChannel, c.config.queue.Name, c.config.exchange.Name, c.config.queue.Patterns, args)

Expand Down

0 comments on commit d846fd8

Please sign in to comment.