Tuesday, 8 October 2019

how to pause kafka consumer



https://github.com/spring-projects/spring-kafka/issues/650




pause:
registry.getListenerContainer(kafkaId).pause();



resume:
registry.getListenerContainer(kafkaId).resume();


registry can be autowired:

@Autowired

private KafkaListenerEndpointRegistry registry;



kafkaid is the id in your consumer anotation:


@KafkaListener(id="this is the id", idIsGroup=false, topics = "topic", containerFactory = "myKafkaListenerFactory")

public void consumeJson(SexObj.....



No comments:

Post a comment