Support passive queue declaration in amqp_consumer (#5831)

This commit is contained in:
Daniel Nelson
2019-05-20 14:38:35 -07:00
committed by GitHub
parent b5cd9a9ff2
commit e141518cf0
5 changed files with 100 additions and 52 deletions

View File

@@ -33,7 +33,7 @@ For an introduction to AMQP see:
# exchange_type = "topic"
## If true, exchange will be passively declared.
# exchange_declare_passive = false
# exchange_passive = false
## Exchange durability can be either "transient" or "durable".
# exchange_durability = "durable"

View File

@@ -92,7 +92,7 @@ var sampleConfig = `
# exchange_type = "topic"
## If true, exchange will be passively declared.
# exchange_declare_passive = false
# exchange_passive = false
## Exchange durability can be either "transient" or "durable".
# exchange_durability = "durable"

View File

@@ -78,6 +78,10 @@ func Connect(config *ClientConfig) (*client, error) {
}
func (c *client) DeclareExchange() error {
if c.config.exchange == "" {
return nil
}
var err error
if c.config.exchangePassive {
err = c.channel.ExchangeDeclarePassive(