@@ -174,14 +174,14 @@ public void close() {
174
174
}
175
175
176
176
void init () {
177
- LOGGER .debug ("Trying to initialize management." );
178
177
if (!this .initialized .get ()) {
178
+ LOGGER .debug ("Initializing management ({})." , this );
179
179
try {
180
- LOGGER .debug ("Creating management session." );
180
+ LOGGER .debug ("Creating management session ({})." , this );
181
181
this .session = this .connection .nativeConnection ().openSession ();
182
182
String linkPairName = "management-link-pair" ;
183
183
Map <String , Object > properties = Collections .singletonMap ("paired" , Boolean .TRUE );
184
- LOGGER .debug ("Creating management sender." );
184
+ LOGGER .debug ("Creating management sender ({})." , this );
185
185
this .sender =
186
186
session .openSender (
187
187
MANAGEMENT_NODE_ADDRESS ,
@@ -190,7 +190,7 @@ void init() {
190
190
.linkName (linkPairName )
191
191
.properties (properties ));
192
192
193
- LOGGER .debug ("Creating management receiver." );
193
+ LOGGER .debug ("Creating management receiver ({})." , this );
194
194
this .receiver =
195
195
session .openReceiver (
196
196
MANAGEMENT_NODE_ADDRESS ,
@@ -201,9 +201,9 @@ void init() {
201
201
.creditWindow (100 ));
202
202
203
203
this .sender .openFuture ().get (this .rpcTimeout .toMillis (), MILLISECONDS );
204
- LOGGER .debug ("Management sender created." );
204
+ LOGGER .debug ("Management sender created ({})." , this );
205
205
this .receiver .openFuture ().get (this .rpcTimeout .toMillis (), MILLISECONDS );
206
- LOGGER .debug ("Management receiver created." );
206
+ LOGGER .debug ("Management receiver created ({})." , this );
207
207
Runnable receiveTask =
208
208
() -> {
209
209
try {
@@ -219,21 +219,23 @@ void init() {
219
219
LOGGER .info ("Could not find outstanding request {}" , correlationId );
220
220
}
221
221
} else {
222
- LOGGER .info ("Could not correlate inbound message with managemement request" );
222
+ LOGGER .info ("Could not correlate inbound message with management request" );
223
223
}
224
224
}
225
225
}
226
226
} catch (ClientConnectionRemotelyClosedException
227
227
| ClientLinkRemotelyClosedException e ) {
228
228
// receiver is closed
229
229
} catch (ClientSessionRemotelyClosedException e ) {
230
- LOGGER .info ("Management session closed in receive loop: {}" , e .getMessage ());
230
+ LOGGER .info (
231
+ "Management session closed in receive loop: {} ({})" , e .getMessage (), this );
231
232
AmqpException exception = ExceptionUtils .convert (e );
232
233
this .releaseResources ();
233
234
this .failRequests (exception );
234
235
if (exception instanceof AmqpException .AmqpSecurityException ) {
235
236
LOGGER .debug (
236
- "Recovering AMQP management because the failure was a security exception" );
237
+ "Recovering AMQP management because the failure was a security exception ({})." ,
238
+ this );
237
239
this .init ();
238
240
}
239
241
} catch (ClientException e ) {
@@ -242,9 +244,9 @@ void init() {
242
244
log .accept ("Error while polling AMQP receiver" );
243
245
}
244
246
};
245
- LOGGER .debug ("Starting management receive loop." );
247
+ LOGGER .debug ("Starting management receive loop ({})." , this );
246
248
this .receiveLoop = this .connection .executorService ().submit (receiveTask );
247
- LOGGER .debug ("Management initialized." );
249
+ LOGGER .debug ("Management initialized ({})." , this );
248
250
this .initialized .set (true );
249
251
} catch (Exception e ) {
250
252
throw new AmqpException (e );
0 commit comments