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 TypeMethodDescriptionvoid
close()
getApp()
getKafkaProperties
(RuntimeConfiguration runtimeConfiguration) This method creates the configuration to run aProducerApp
.Get topic configurationwithRuntimeConfiguration
(RuntimeConfiguration runtimeConfiguration) Create anExecutableProducerApp
using 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_CONFIG
andProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG
is configured usingProducerApp.defaultSerializationConfig()
- Parameters:
runtimeConfiguration
- configuration to run app with- Returns:
- Kafka configuration
-
-
withRuntimeConfiguration
Create anExecutableProducerApp
using the providedRuntimeConfiguration
- Specified by:
withRuntimeConfiguration
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConfiguredApp<T extends ProducerApp>
-
getApp
-