diff --git a/internal/config/notify/parse.go b/internal/config/notify/parse.go index c08606d4e..8005c2ef2 100644 --- a/internal/config/notify/parse.go +++ b/internal/config/notify/parse.go @@ -34,6 +34,7 @@ import ( "github.com/minio/minio/internal/logger" "github.com/minio/pkg/v3/env" xnet "github.com/minio/pkg/v3/net" + "github.com/rabbitmq/amqp091-go" ) const ( @@ -1705,7 +1706,7 @@ func GetNotifyAMQP(amqpKVS map[string]config.KVS) (map[string]target.AMQPArgs, e if k != config.Default { urlEnv = urlEnv + config.Default + k } - url, err := xnet.ParseURL(env.Get(urlEnv, kv.Get(target.AmqpURL))) + url, err := amqp091.ParseURI(env.Get(urlEnv, kv.Get(target.AmqpURL))) if err != nil { return nil, err } @@ -1771,7 +1772,7 @@ func GetNotifyAMQP(amqpKVS map[string]config.KVS) (map[string]target.AMQPArgs, e } amqpArgs := target.AMQPArgs{ Enable: enabled, - URL: *url, + URL: url, Exchange: env.Get(exchangeEnv, kv.Get(target.AmqpExchange)), RoutingKey: env.Get(routingKeyEnv, kv.Get(target.AmqpRoutingKey)), ExchangeType: env.Get(exchangeTypeEnv, kv.Get(target.AmqpExchangeType)), diff --git a/internal/event/target/amqp.go b/internal/event/target/amqp.go index 0707bae33..8b001f5db 100644 --- a/internal/event/target/amqp.go +++ b/internal/event/target/amqp.go @@ -38,21 +38,21 @@ import ( // AMQPArgs - AMQP target arguments. type AMQPArgs struct { - Enable bool `json:"enable"` - URL xnet.URL `json:"url"` - Exchange string `json:"exchange"` - RoutingKey string `json:"routingKey"` - ExchangeType string `json:"exchangeType"` - DeliveryMode uint8 `json:"deliveryMode"` - Mandatory bool `json:"mandatory"` - Immediate bool `json:"immediate"` - Durable bool `json:"durable"` - Internal bool `json:"internal"` - NoWait bool `json:"noWait"` - AutoDeleted bool `json:"autoDeleted"` - PublisherConfirms bool `json:"publisherConfirms"` - QueueDir string `json:"queueDir"` - QueueLimit uint64 `json:"queueLimit"` + Enable bool `json:"enable"` + URL amqp091.URI `json:"url"` + Exchange string `json:"exchange"` + RoutingKey string `json:"routingKey"` + ExchangeType string `json:"exchangeType"` + DeliveryMode uint8 `json:"deliveryMode"` + Mandatory bool `json:"mandatory"` + Immediate bool `json:"immediate"` + Durable bool `json:"durable"` + Internal bool `json:"internal"` + NoWait bool `json:"noWait"` + AutoDeleted bool `json:"autoDeleted"` + PublisherConfirms bool `json:"publisherConfirms"` + QueueDir string `json:"queueDir"` + QueueLimit uint64 `json:"queueLimit"` } // AMQP input constants.