Skip to content

Commit 014f5a9

Browse files
committed
More logging details in AMQP management
1 parent d4e9b6c commit 014f5a9

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/main/java/com/rabbitmq/client/amqp/impl/AmqpManagement.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ public void close() {
174174
}
175175

176176
void init() {
177-
LOGGER.debug("Trying to initialize management.");
178177
if (!this.initialized.get()) {
178+
LOGGER.debug("Initializing management ({}).", this);
179179
try {
180-
LOGGER.debug("Creating management session.");
180+
LOGGER.debug("Creating management session ({}).", this);
181181
this.session = this.connection.nativeConnection().openSession();
182182
String linkPairName = "management-link-pair";
183183
Map<String, Object> properties = Collections.singletonMap("paired", Boolean.TRUE);
184-
LOGGER.debug("Creating management sender.");
184+
LOGGER.debug("Creating management sender ({}).", this);
185185
this.sender =
186186
session.openSender(
187187
MANAGEMENT_NODE_ADDRESS,
@@ -190,7 +190,7 @@ void init() {
190190
.linkName(linkPairName)
191191
.properties(properties));
192192

193-
LOGGER.debug("Creating management receiver.");
193+
LOGGER.debug("Creating management receiver ({}).", this);
194194
this.receiver =
195195
session.openReceiver(
196196
MANAGEMENT_NODE_ADDRESS,
@@ -201,9 +201,9 @@ void init() {
201201
.creditWindow(100));
202202

203203
this.sender.openFuture().get(this.rpcTimeout.toMillis(), MILLISECONDS);
204-
LOGGER.debug("Management sender created.");
204+
LOGGER.debug("Management sender created ({}).", this);
205205
this.receiver.openFuture().get(this.rpcTimeout.toMillis(), MILLISECONDS);
206-
LOGGER.debug("Management receiver created.");
206+
LOGGER.debug("Management receiver created ({}).", this);
207207
Runnable receiveTask =
208208
() -> {
209209
try {
@@ -219,21 +219,23 @@ void init() {
219219
LOGGER.info("Could not find outstanding request {}", correlationId);
220220
}
221221
} else {
222-
LOGGER.info("Could not correlate inbound message with managemement request");
222+
LOGGER.info("Could not correlate inbound message with management request");
223223
}
224224
}
225225
}
226226
} catch (ClientConnectionRemotelyClosedException
227227
| ClientLinkRemotelyClosedException e) {
228228
// receiver is closed
229229
} 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);
231232
AmqpException exception = ExceptionUtils.convert(e);
232233
this.releaseResources();
233234
this.failRequests(exception);
234235
if (exception instanceof AmqpException.AmqpSecurityException) {
235236
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);
237239
this.init();
238240
}
239241
} catch (ClientException e) {
@@ -242,9 +244,9 @@ void init() {
242244
log.accept("Error while polling AMQP receiver");
243245
}
244246
};
245-
LOGGER.debug("Starting management receive loop.");
247+
LOGGER.debug("Starting management receive loop ({}).", this);
246248
this.receiveLoop = this.connection.executorService().submit(receiveTask);
247-
LOGGER.debug("Management initialized.");
249+
LOGGER.debug("Management initialized ({}).", this);
248250
this.initialized.set(true);
249251
} catch (Exception e) {
250252
throw new AmqpException(e);

src/main/java/com/rabbitmq/client/amqp/impl/UriUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
abstract class UriUtils {
2626

27-
// based Apache HttpComponents PercentCodec
27+
// based on Apache HttpComponents PercentCodec
2828

2929
private UriUtils() {}
3030

0 commit comments

Comments
 (0)