private Connection createAMQPConnection(int testPort, boolean useSSL) throws JMSException {
LOG.debug("In createConnection using port {} ssl? {}", testPort, useSSL);
final ConnectionFactoryImpl connectionFactory = new ConnectionFactoryImpl("localhost", testPort, "admin", "password", null, useSSL);
connectionFactory.setSyncPublish(true);
final Connection connection = connectionFactory.createConnection();
connection.setExceptionListener(new ExceptionListener() {
@Override
public void onException(JMSException exception) {
exception.printStackTrace();
}