List of usage examples for org.springframework.kafka.core DefaultKafkaConsumerFactory DefaultKafkaConsumerFactory
public DefaultKafkaConsumerFactory(Map<String, Object> configs,
@Nullable Supplier<Deserializer<K>> keyDeserializerSupplier,
@Nullable Supplier<Deserializer<V>> valueDeserializerSupplier)
From source file:org.s1p.JsonConfiguration.java
@Bean public ConsumerFactory<String, Foo> consumerFactory() { Map<String, Object> props = new HashMap<>(); props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, this.configProperties.getBrokerAddress()); props.put(ConsumerConfig.GROUP_ID_CONFIG, "s1pGroup"); props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, true); props.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, 100); props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, 15000); JsonDeserializer<Foo> jsonDeserializer = new JsonDeserializer<>(Foo.class); return new DefaultKafkaConsumerFactory<>(props, new StringDeserializer(), jsonDeserializer); }