mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
Removed clientID from NATS-Streaming Config (#6391)
clientID must be a unique `UUID` for each connections. Now, the server generates it, rather considering the config. Removing it as it is non-beneficial right now. Fixes #6364
This commit is contained in:
committed by
Nitish Tiwari
parent
e7971b1d55
commit
e7af31c2ff
@@ -40,7 +40,6 @@ type NATSArgs struct {
|
||||
Streaming struct {
|
||||
Enable bool `json:"enable"`
|
||||
ClusterID string `json:"clusterID"`
|
||||
ClientID string `json:"clientID"`
|
||||
Async bool `json:"async"`
|
||||
MaxPubAcksInflight int `json:"maxPubAcksInflight"`
|
||||
} `json:"streaming"`
|
||||
@@ -64,9 +63,6 @@ func (n NATSArgs) Validate() error {
|
||||
if n.Streaming.ClusterID == "" {
|
||||
return errors.New("empty cluster id")
|
||||
}
|
||||
if n.Streaming.ClientID == "" {
|
||||
return errors.New("empty client id")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -128,6 +124,7 @@ func (target *NATSTarget) Close() (err error) {
|
||||
func NewNATSTarget(id string, args NATSArgs) (*NATSTarget, error) {
|
||||
var natsConn *nats.Conn
|
||||
var stanConn stan.Conn
|
||||
var clientID string
|
||||
var err error
|
||||
|
||||
if args.Streaming.Enable {
|
||||
@@ -137,12 +134,9 @@ func NewNATSTarget(id string, args NATSArgs) (*NATSTarget, error) {
|
||||
}
|
||||
addressURL := scheme + "://" + args.Username + ":" + args.Password + "@" + args.Address.String()
|
||||
|
||||
clientID := args.Streaming.ClientID
|
||||
if clientID == "" {
|
||||
clientID, err = getNewUUID()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clientID, err = getNewUUID()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
connOpts := []stan.Option{stan.NatsURL(addressURL)}
|
||||
|
||||
Reference in New Issue
Block a user