@@ -3,7 +3,6 @@ package natsnodev1
33import (
44 "context"
55 "fmt"
6- "math/rand"
76 "net/url"
87 "strconv"
98 "strings"
@@ -76,14 +75,14 @@ func (b *Binding) Bind(_ context.Context, bindings *sdkv2betalib.Bindings) *sdkv
7675 panic ("Please provide Nats username and password; This allows for connecting to the NATS server from the NATS client" )
7776 }
7877
79- r := rand .New (rand .NewSource (time .Now ().UnixNano ()))
78+ // r := rand.New(rand.NewSource(time.Now().UnixNano()))
8079
8180 systemAccount := natsd .NewAccount (natsd .DEFAULT_SYSTEM_ACCOUNT )
8281 connectorAccount := natsd .NewAccount (DEFAULT_CONNECTOR_ACCOUNT )
8382
8483 options := natsd.Options {
8584 // Standard client options
86- ServerName : b .configuration .Natsd .ServerName + "-" + fmt . Sprintf ( "%03d" , r . Intn ( 900 ) + 100 ) ,
85+ ServerName : b .configuration .Natsd .ServerName ,
8786 Host : b .configuration .Natsd .Host ,
8887 Port : b .configuration .Natsd .Port ,
8988 HTTPPort : b .configuration .Natsd .HTTPPort ,
@@ -129,6 +128,7 @@ func (b *Binding) Bind(_ context.Context, bindings *sdkv2betalib.Bindings) *sdkv
129128 Port : b .configuration .Natsd .Cluster .Port ,
130129 Name : b .configuration .Natsd .Cluster .Name ,
131130 ConnectRetries : 3 ,
131+ ConnectBackoff : true ,
132132 PoolSize : b .configuration .Natsd .Replicas ,
133133 Compression : natsd.CompressionOpts {
134134 Mode : "s2_auto" ,
0 commit comments