Package com.bakdata.kafka.consumer
Class ConsumerCleanUpRunner
java.lang.Object
com.bakdata.kafka.consumer.ConsumerCleanUpRunner
- All Implemented Interfaces:
CleanUpRunner,AutoCloseable
Clean up all topics specified by a
ConsumerTopicConfig-
Method Summary
Modifier and TypeMethodDescriptionvoidclean()Clean all resources associated with an applicationvoidclose()static ConsumerCleanUpRunnercreate(@NonNull ConsumerTopicConfig topics, @NonNull Map<String, Object> kafkaProperties, @NonNull String groupId) Create a newConsumerCleanUpRunnerwith defaultConsumerCleanUpConfigurationstatic ConsumerCleanUpRunnercreate(@NonNull ConsumerTopicConfig topics, @NonNull Map<String, Object> kafkaProperties, @NonNull String groupId, @NonNull ConsumerCleanUpConfiguration configuration) Create a newConsumerCleanUpRunnervoidreset()Reset your Consumer app by resetting consumer group offsets
-
Method Details
-
create
public static ConsumerCleanUpRunner create(@NonNull @NonNull ConsumerTopicConfig topics, @NonNull @NonNull Map<String, Object> kafkaProperties, @NonNull @NonNull String groupId) Create a newConsumerCleanUpRunnerwith defaultConsumerCleanUpConfiguration- Parameters:
topics- topic configurationkafkaProperties- configuration to connect to Kafka admin toolsgroupId- consumer group id to clean up- Returns:
ConsumerCleanUpRunner
-
create
public static ConsumerCleanUpRunner create(@NonNull @NonNull ConsumerTopicConfig topics, @NonNull @NonNull Map<String, Object> kafkaProperties, @NonNull @NonNull String groupId, @NonNull @NonNull ConsumerCleanUpConfiguration configuration) Create a newConsumerCleanUpRunner- Parameters:
topics- topic configurationkafkaProperties- configuration to connect to Kafka admin toolsgroupId- consumer group id to clean upconfiguration- configuration for hooks that are called when runningclean()- Returns:
ConsumerCleanUpRunner
-
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 Consumer app by resetting consumer group offsets
-