Package com.bakdata.kafka.consumer
Class ConfiguredConsumerApp<T extends ConsumerApp>
java.lang.Object
com.bakdata.kafka.consumer.ConfiguredConsumerApp<T>
- Type Parameters:
T- type ofConsumerApp
- All Implemented Interfaces:
ConfiguredApp<ExecutableConsumerApp<T>>,AutoCloseable
public class ConfiguredConsumerApp<T extends ConsumerApp>
extends Object
implements ConfiguredApp<ExecutableConsumerApp<T>>
A
ConsumerApp with a corresponding ConsumerAppConfiguration-
Constructor Summary
ConstructorsConstructorDescriptionConfiguredConsumerApp(T app, @NonNull ConsumerAppConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Base configuration for all consumer apps which includesgetApp()getKafkaProperties(RuntimeConfiguration runtimeConfiguration) This method creates the configuration to run aConsumerApp.Get topic configurationGet unique group identifier ofConsumerAppwithRuntimeConfiguration(RuntimeConfiguration runtimeConfiguration) Create anExecutableConsumerAppusing the providedRuntimeConfiguration
-
Constructor Details
-
ConfiguredConsumerApp
public ConfiguredConsumerApp(@NonNull T app, @NonNull @NonNull ConsumerAppConfiguration configuration)
-
-
Method Details
-
createBaseConfig
Base configuration for all consumer apps which includesauto.offset.reset=earliest enable.auto.commit=false isolation.level=read_committed
- Returns:
- base configuration
-
getKafkaProperties
This method creates the configuration to run a
Configuration is created in the following orderConsumerApp.-
auto.offset.reset=earliest enable.auto.commit=false isolation.level=read_committed
-
Configs provided by
App.createKafkaProperties() -
Configs provided via environment variables (see
EnvironmentKafkaConfigParser.parseVariables(Map)) -
Configs provided by
RuntimeConfiguration.createKafkaProperties() -
ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIGandConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIGis configured usingConsumerApp.defaultSerializationConfig()
- Parameters:
runtimeConfiguration- configuration to run app with- Returns:
- Kafka configuration
-
-
getUniqueGroupId
Get unique group identifier ofConsumerApp- Returns:
- unique group identifier
- Throws:
IllegalArgumentException- if unique group identifier ofConsumerAppis different from provided group identifier inConsumerAppConfiguration- See Also:
-
withRuntimeConfiguration
Create anExecutableConsumerAppusing the providedRuntimeConfiguration- Specified by:
withRuntimeConfigurationin interfaceConfiguredApp<T extends ConsumerApp>- Parameters:
runtimeConfiguration- configuration to run app with- Returns:
ExecutableConsumerApp
-
getTopics
Get topic configuration- Returns:
- topic configuration
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConfiguredApp<T extends ConsumerApp>
-
getApp
-