Skip to content

Instantly share code, notes, and snippets.

@adamrabung
Created January 2, 2012 16:53
Show Gist options
  • Save adamrabung/1551353 to your computer and use it in GitHub Desktop.
Save adamrabung/1551353 to your computer and use it in GitHub Desktop.
ConnectionFactory factory = new ConnectionFactory();
Address[] adds = new Address[] { new Address("localhost", 5672), new Address("localhost", 5673), new Address("localhost", 5674) };
Connection conn = factory.newConnection(adds);
conn.addShutdownListener(new ShutdownListener() {
@Override
public void shutdownCompleted(ShutdownSignalException cause) {
System.out.println("Connection shut down");
}
});
Channel ch = conn.createChannel();
ch.addShutdownListener(new ShutdownListener() {
@Override
public void shutdownCompleted(ShutdownSignalException cause) {
System.out.println("Channel shut down");
}
});
Thread.sleep(2389234892l);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment