Skip to content

Commit a181010

Browse files
committed
Add extra exception handling
1 parent f18b94b commit a181010

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/com/zeroclue/jmeter/protocol/amqp/AMQPSampler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919

2020
import com.rabbitmq.client.AMQP;
2121
import com.rabbitmq.client.Address;
22+
import com.rabbitmq.client.AlreadyClosedException;
2223
import com.rabbitmq.client.Channel;
2324
import com.rabbitmq.client.Connection;
2425
import com.rabbitmq.client.ConnectionFactory;
26+
import com.rabbitmq.client.ShutdownSignalException;
2527

2628
public abstract class AMQPSampler extends AbstractSampler implements ThreadListener {
2729

@@ -438,6 +440,10 @@ protected void cleanup() {
438440
}
439441
} catch (IOException e) {
440442
log.error("Failed to close connection", e);
443+
} catch (AlreadyClosedException e) {
444+
log.error("Connection already closed", e);
445+
} catch (ShutdownSignalException e) {
446+
log.error("Connection shutdown by thread close", e);
441447
}
442448
}
443449

0 commit comments

Comments
 (0)