mirror of
https://github.com/minio/minio.git
synced 2025-10-28 23:35:01 -04:00
fix: use amqp.ParseURL to parse amqp url (#21528)
This commit is contained in:
parent
5a35585acd
commit
86d9d9b55e
@ -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)),
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user