protected static void validateZooKeeperConfig ( Properties props ) { if ( props . getProperty ( "zookeeper.connect" ) == null ) { throw new IllegalArgumentException ( "Required property 'zookeeper.connect' has not been set in the properties" ) ; } if ( props . getProperty ( ConsumerConfig . GROUP_ID_CONFIG ) == null ) { throw new IllegalArgumentException ( "Required property '" + ConsumerConfig . GROUP_ID_CONFIG + "' has not been set in the properties" ) ; } try { //noinspection ResultOfMethodCallIgnored Integer . parseInt ( props . getProperty ( "zookeeper.session.timeout.ms" , "0" ) ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Property 'zookeeper.session.timeout.ms' is not a valid integer" ) ; } try { //noinspection ResultOfMethodCallIgnored Integer . parseInt ( props . getProperty ( "zookeeper.connection.timeout.ms" , "0" ) ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Property 'zookeeper.connection.timeout.ms' is not a valid integer" ) ; } }
Validate the ZK configuration checking for required parameters .