Support passive queue declaration in amqp_consumer (#5831)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user