@Test void testGetKafkaProps() { final NotificationsConfiguration c = new NotificationsConfiguration(); c.set("batch.size", "1000"); c.set("retries", "10"); c.set("some.other", "value"); c.set("key.serializer", "some.bogus.key.serializer"); c.setConnectionString("localhost:9092"); final Properties p = AppUtils.getKafkaProperties(c); assertEquals("all", p.getProperty("acks"), "Incorrect kafka acks property!"); assertEquals("value", p.getProperty("some.other"), "Incorrect custom property!"); assertEquals("org.apache.kafka.common.serialization.StringSerializer", p.getProperty("key.serializer"), "Incorrect serializer class property!"); assertEquals("localhost:9092", p.getProperty("bootstrap.servers"), "Incorrect bootstrap.servers property!"); }
public static Properties getKafkaProperties(final NotificationsConfiguration config) { final Properties p = new Properties(); p.setProperty("acks", config.any().getOrDefault("acks", "all")); p.setProperty("batch.size", config.any().getOrDefault("batch.size", "16384")); p.setProperty("retries", config.any().getOrDefault("retries", "0")); p.setProperty("linger.ms", config.any().getOrDefault("linger.ms", "1")); p.setProperty("buffer.memory", config.any().getOrDefault("buffer.memory", "33554432")); config.any().forEach(p::setProperty); p.setProperty("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("bootstrap.servers", config.getConnectionString()); return p; }
AppUtils { public static Properties getKafkaProperties(final NotificationsConfiguration config) { final Properties p = new Properties(); p.setProperty("acks", config.any().getOrDefault("acks", "all")); p.setProperty("batch.size", config.any().getOrDefault("batch.size", "16384")); p.setProperty("retries", config.any().getOrDefault("retries", "0")); p.setProperty("linger.ms", config.any().getOrDefault("linger.ms", "1")); p.setProperty("buffer.memory", config.any().getOrDefault("buffer.memory", "33554432")); config.any().forEach(p::setProperty); p.setProperty("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("bootstrap.servers", config.getConnectionString()); return p; } }
AppUtils { public static Properties getKafkaProperties(final NotificationsConfiguration config) { final Properties p = new Properties(); p.setProperty("acks", config.any().getOrDefault("acks", "all")); p.setProperty("batch.size", config.any().getOrDefault("batch.size", "16384")); p.setProperty("retries", config.any().getOrDefault("retries", "0")); p.setProperty("linger.ms", config.any().getOrDefault("linger.ms", "1")); p.setProperty("buffer.memory", config.any().getOrDefault("buffer.memory", "33554432")); config.any().forEach(p::setProperty); p.setProperty("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("bootstrap.servers", config.getConnectionString()); return p; } private  AppUtils(); }
AppUtils { public static Properties getKafkaProperties(final NotificationsConfiguration config) { final Properties p = new Properties(); p.setProperty("acks", config.any().getOrDefault("acks", "all")); p.setProperty("batch.size", config.any().getOrDefault("batch.size", "16384")); p.setProperty("retries", config.any().getOrDefault("retries", "0")); p.setProperty("linger.ms", config.any().getOrDefault("linger.ms", "1")); p.setProperty("buffer.memory", config.any().getOrDefault("buffer.memory", "33554432")); config.any().forEach(p::setProperty); p.setProperty("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("bootstrap.servers", config.getConnectionString()); return p; } private  AppUtils(); static Properties getKafkaProperties(final NotificationsConfiguration config); static ActiveMQConnectionFactory getJmsFactory(final NotificationsConfiguration config); static EventService getNotificationService(final NotificationsConfiguration config,
            final Environment environment); }
AppUtils { public static Properties getKafkaProperties(final NotificationsConfiguration config) { final Properties p = new Properties(); p.setProperty("acks", config.any().getOrDefault("acks", "all")); p.setProperty("batch.size", config.any().getOrDefault("batch.size", "16384")); p.setProperty("retries", config.any().getOrDefault("retries", "0")); p.setProperty("linger.ms", config.any().getOrDefault("linger.ms", "1")); p.setProperty("buffer.memory", config.any().getOrDefault("buffer.memory", "33554432")); config.any().forEach(p::setProperty); p.setProperty("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); p.setProperty("bootstrap.servers", config.getConnectionString()); return p; } private  AppUtils(); static Properties getKafkaProperties(final NotificationsConfiguration config); static ActiveMQConnectionFactory getJmsFactory(final NotificationsConfiguration config); static EventService getNotificationService(final NotificationsConfiguration config,
            final Environment environment);  }