Skip to content

Commit 21cc368

Browse files
author
Marek Majkowski
committed
Merged bug21748 into default.
2 parents 2f128bc + af0b4fd commit 21cc368

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ public void start(boolean insist)
226226
_frameHandler.setTimeout(HANDSHAKE_TIMEOUT);
227227
_frameHandler.sendHeader();
228228

229-
new MainLoop().start(); // start the main loop going
229+
// start the main loop going
230+
Thread ml = new MainLoop();
231+
ml.setName("AMQP Connection " + getHost() + ":" + getPort());
232+
ml.start();
230233

231234
try {
232235
// See bug 17389. The MainLoop could have shut down already in
@@ -548,15 +551,17 @@ public void handleConnectionClose(Command closeCommand) {
548551
}
549552
_heartbeat = 0; // Do not try to send heartbeats after CloseOk
550553
_brokerInitiatedShutdown = true;
551-
new SocketCloseWait(sse);
554+
Thread scw = new SocketCloseWait(sse);
555+
scw.setName("AMQP Connection Closing Monitor " +
556+
getHost() + ":" + getPort());
557+
scw.start();
552558
}
553559

554560
private class SocketCloseWait extends Thread {
555561
private ShutdownSignalException cause;
556562

557563
public SocketCloseWait(ShutdownSignalException sse) {
558564
cause = sse;
559-
start();
560565
}
561566

562567
@Override public void run() {

0 commit comments

Comments
 (0)