@@ -175,7 +175,7 @@ class StreamEnvironment implements Environment {
175
175
if (uris .isEmpty ()) {
176
176
this .addresses =
177
177
Collections .singletonList (
178
- new Address (clientParametersPrototype .host , clientParametersPrototype .port ));
178
+ new Address (clientParametersPrototype .host () , clientParametersPrototype .port () ));
179
179
} else {
180
180
int defaultPort = tls ? Client .DEFAULT_TLS_PORT : Client .DEFAULT_PORT ;
181
181
this .addresses =
@@ -241,15 +241,15 @@ class StreamEnvironment implements Environment {
241
241
: addresses .get (random .nextInt (addresses .size ()));
242
242
address = addressResolver .resolve (address );
243
243
LOGGER .debug ("Trying to reconnect locator on {}" , address );
244
+ String connectionName =
245
+ connectionNamingStrategy .apply (ClientConnectionType .LOCATOR );
244
246
Client newLocator =
245
247
clientFactory .apply (
246
248
newLocatorParameters
247
249
.host (address .host ())
248
250
.port (address .port ())
249
- .clientProperty (
250
- "connection_name" ,
251
- connectionNamingStrategy .apply (
252
- ClientConnectionType .LOCATOR )));
251
+ .clientProperty ("connection_name" , connectionName ));
252
+ LOGGER .debug ("Created locator connection '{}'" , connectionName );
253
253
LOGGER .debug ("Locator connected on {}" , address );
254
254
return newLocator ;
255
255
})
@@ -267,17 +267,17 @@ class StreamEnvironment implements Environment {
267
267
RuntimeException lastException = null ;
268
268
for (Address address : addresses ) {
269
269
address = addressResolver .resolve (address );
270
+ String connectionName = connectionNamingStrategy .apply (ClientConnectionType .LOCATOR );
270
271
Client .ClientParameters locatorParameters =
271
272
clientParametersForInit
272
273
.duplicate ()
273
274
.host (address .host ())
274
275
.port (address .port ())
275
- .clientProperty (
276
- "connection_name" ,
277
- connectionNamingStrategy .apply (ClientConnectionType .LOCATOR ))
276
+ .clientProperty ("connection_name" , connectionName )
278
277
.shutdownListener (shutdownListenerReference .get ());
279
278
try {
280
279
this .locator = clientFactory .apply (locatorParameters );
280
+ LOGGER .debug ("Created locator connection '{}'" , connectionName );
281
281
LOGGER .debug ("Locator connected to {}" , address );
282
282
break ;
283
283
} catch (RuntimeException e ) {
@@ -297,7 +297,9 @@ class StreamEnvironment implements Environment {
297
297
this .locatorInitializationSequence = () -> {};
298
298
}
299
299
this .codec =
300
- clientParametersPrototype .codec == null ? Codecs .DEFAULT : clientParametersPrototype .codec ;
300
+ clientParametersPrototype .codec () == null
301
+ ? Codecs .DEFAULT
302
+ : clientParametersPrototype .codec ();
301
303
this .clockRefreshFuture =
302
304
this .scheduledExecutorService .scheduleAtFixedRate (
303
305
() -> this .clock .refresh (), 1 , 1 , SECONDS );
0 commit comments