Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
LOG.info("Received a shutdown signal. Stopping participant");
containerParticipant.stopAsync();
containerParticipant.awaitTerminated();
connection.disconnect();
}
}) {
});