Package com.bakdata.kafka.producer
Class ConfiguredProducerApp<T extends ProducerApp>
java.lang.Object
com.bakdata.kafka.producer.ConfiguredProducerApp<T>
- Type Parameters:
T- type ofProducerApp
- All Implemented Interfaces:
ConfiguredApp<ExecutableProducerApp<T>>,AutoCloseable
public class ConfiguredProducerApp<T extends ProducerApp>
extends Object
implements ConfiguredApp<ExecutableProducerApp<T>>
A
ProducerApp with a corresponding ProducerAppConfiguration-
Constructor Summary
ConstructorsConstructorDescriptionConfiguredProducerApp(T app, @NonNull ProducerAppConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getApp()getKafkaProperties(RuntimeConfiguration runtimeConfiguration) This method creates the configuration to run aProducerApp.Get topic configurationwithRuntimeConfiguration(RuntimeConfiguration runtimeConfiguration) Create anExecutableProducerAppusing the providedRuntimeConfiguration
-
Constructor Details
-
ConfiguredProducerApp
public ConfiguredProducerApp(@NonNull T app, @NonNull @NonNull ProducerAppConfiguration configuration)
-
-
Method Details
-
getKafkaProperties
This method creates the configuration to run a
Configuration is created in the following orderProducerApp.-
max.in.flight.requests.per.connection=1 acks=all compression.type=gzip
-
Configs provided by
App.createKafkaProperties() -
Configs provided via environment variables (see
EnvironmentKafkaConfigParser.parseVariables(Map)) -
Configs provided by
RuntimeConfiguration.createKafkaProperties() -
ProducerConfig.KEY_SERIALIZER_CLASS_CONFIGandProducerConfig.VALUE_SERIALIZER_CLASS_CONFIGis configured usingProducerApp.defaultSerializationConfig()
- Parameters:
runtimeConfiguration- configuration to run app with- Returns:
- Kafka configuration
-
-
withRuntimeConfiguration
Create anExecutableProducerAppusing the providedRuntimeConfiguration- Specified by:
withRuntimeConfigurationin interfaceConfiguredApp<T extends ProducerApp>- Parameters:
runtimeConfiguration- configuration to run app with- Returns:
ExecutableProducerApp
-
getTopics
Get topic configuration- Returns:
- topic configuration
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConfiguredApp<T extends ProducerApp>
-
getApp
-