Class ConsumerProducerCleanUpRunner
java.lang.Object
com.bakdata.kafka.consumerproducer.ConsumerProducerCleanUpRunner
- All Implemented Interfaces:
CleanUpRunner,AutoCloseable
Runner to
clean() or reset() a ConsumerProducerApp
clean() deletes all output topics specified by a ConsumerProducerTopicConfig and the consumer group
specified in the constructor. reset() resets the consumer group to the earliest offset. Both methods also
run hooks registered in a ConsumerProducerCleanUpConfiguration.-
Method Summary
Modifier and TypeMethodDescriptionvoidclean()Clean all resources associated with an applicationvoidclose()create(@NonNull ConsumerProducerTopicConfig topics, @NonNull Map<String, Object> kafkaProperties, @NonNull String groupId) Create a newConsumerProducerCleanUpRunnerwith defaultConsumerProducerCleanUpConfigurationcreate(@NonNull ConsumerProducerTopicConfig topics, @NonNull Map<String, Object> kafkaProperties, @NonNull String groupId, @NonNull ConsumerProducerCleanUpConfiguration configuration) Create a newConsumerProducerCleanUpRunnervoidreset()Reset your ConsumerProducer app by resetting consumer group offsets
-
Method Details
-
create
public static ConsumerProducerCleanUpRunner create(@NonNull @NonNull ConsumerProducerTopicConfig topics, @NonNull @NonNull Map<String, Object> kafkaProperties, @NonNull @NonNull String groupId) Create a newConsumerProducerCleanUpRunnerwith defaultConsumerProducerCleanUpConfiguration- Parameters:
topics- topic configurationkafkaProperties- configuration to connect to Kafka admin toolsgroupId- consumer group id to clean up- Returns:
ConsumerProducerCleanUpRunner
-
create
public static ConsumerProducerCleanUpRunner create(@NonNull @NonNull ConsumerProducerTopicConfig topics, @NonNull @NonNull Map<String, Object> kafkaProperties, @NonNull @NonNull String groupId, @NonNull @NonNull ConsumerProducerCleanUpConfiguration configuration) Create a newConsumerProducerCleanUpRunner- Parameters:
topics- topic configurationkafkaProperties- configuration to connect to Kafka admin toolsgroupId- consumer group id to clean upconfiguration- configuration for hooks that are called during clean up and reset- Returns:
ConsumerProducerCleanUpRunner
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCleanUpRunner
-
clean
public void clean()Description copied from interface:CleanUpRunnerClean all resources associated with an application- Specified by:
cleanin interfaceCleanUpRunner
-
reset
public void reset()Reset your ConsumerProducer app by resetting consumer group offsets
-