/** * Set multiple configuration properties. Several key properties that deal with Zookeeper, the host name, and the broker ID, * may not be set via this method and are ignored since they are controlled elsewhere in this instance. * * @param properties the configuration properties; may be null or empty * @return this instance to allow chaining methods; never null * @throws IllegalStateException if the server is running when this method is called */ public KafkaServer setProperties( Properties properties ) { if (server != null) throw new IllegalStateException("Unable to change the properties when already running"); properties.stringPropertyNames().forEach(propName -> { setProperty(propName, properties.getProperty(propName)); }); return this; }