public synchronized void shutdown(){
  if (server != null) {
    try {
      server.shutdown();
      LOGGER.info("Stopped Kafka server {} at {}",brokerId,getConnection());
    }
  finally {
      server=null;
      port=desiredPort;
    }
  }
}

public synchronized void shutdown ( ) { if ( server != null ) { try { server . shutdown ( ) ; LOGGER . info ( "Stopped Kafka server {} at {}" , brokerId , getConnection ( ) ) ; } finally { server = null ; port = desiredPort ; } } }
shutdown the embedded kafka server and delete all data .
