@@ -22,6 +22,7 @@ type queueSettings struct {
22
22
BatchLength int
23
23
ConnectionString string
24
24
Type string
25
+ Network string
25
26
Addresses string
26
27
Password string
27
28
QueueName string
@@ -47,6 +48,7 @@ func CreateQueue(name string, handle queue.HandlerFunc, exemplar interface{}) qu
47
48
opts ["BatchLength" ] = q .BatchLength
48
49
opts ["DataDir" ] = q .DataDir
49
50
opts ["Addresses" ] = q .Addresses
51
+ opts ["Network" ] = q .Network
50
52
opts ["Password" ] = q .Password
51
53
opts ["DBIndex" ] = q .DBIndex
52
54
opts ["QueueName" ] = q .QueueName
@@ -111,7 +113,7 @@ func getQueueSettings(name string) queueSettings {
111
113
q .BoostWorkers = sec .Key ("BOOST_WORKERS" ).MustInt (Queue .BoostWorkers )
112
114
q .QueueName = sec .Key ("QUEUE_NAME" ).MustString (Queue .QueueName )
113
115
114
- q .Addresses , q .Password , q .DBIndex , _ = ParseQueueConnStr (q .ConnectionString )
116
+ q .Network , q . Addresses , q .Password , q .DBIndex , _ = ParseQueueConnStr (q .ConnectionString )
115
117
return q
116
118
}
117
119
@@ -128,7 +130,7 @@ func NewQueueService() {
128
130
Queue .ConnectionString = sec .Key ("CONN_STR" ).MustString (path .Join (AppDataPath , "" ))
129
131
validTypes := queue .RegisteredTypesAsString ()
130
132
Queue .Type = sec .Key ("TYPE" ).In (string (queue .PersistableChannelQueueType ), validTypes )
131
- Queue .Addresses , Queue .Password , Queue .DBIndex , _ = ParseQueueConnStr (Queue .ConnectionString )
133
+ Queue .Network , Queue . Addresses , Queue .Password , Queue .DBIndex , _ = ParseQueueConnStr (Queue .ConnectionString )
132
134
Queue .WrapIfNecessary = sec .Key ("WRAP_IF_NECESSARY" ).MustBool (true )
133
135
Queue .MaxAttempts = sec .Key ("MAX_ATTEMPTS" ).MustInt (10 )
134
136
Queue .Timeout = sec .Key ("TIMEOUT" ).MustDuration (GracefulHammerTime + 30 * time .Second )
@@ -183,14 +185,16 @@ func NewQueueService() {
183
185
}
184
186
185
187
// ParseQueueConnStr parses a queue connection string
186
- func ParseQueueConnStr (connStr string ) (addrs , password string , dbIdx int , err error ) {
188
+ func ParseQueueConnStr (connStr string ) (network , addrs , password string , dbIdx int , err error ) {
187
189
fields := strings .Fields (connStr )
188
190
for _ , f := range fields {
189
191
items := strings .SplitN (f , "=" , 2 )
190
192
if len (items ) < 2 {
191
193
continue
192
194
}
193
195
switch strings .ToLower (items [0 ]) {
196
+ case "network" :
197
+ network = items [1 ]
194
198
case "addrs" :
195
199
addrs = items [1 ]
196
200
case "password" :
0 commit comments