Open SouquieresAdam opened 4 months ago
@SouquieresAdam,
Good issue,
I have considered something like:
kafkaProperties
KafkaStreamsExecutionContext
, add a new attribute applicationProperties
containing all other properties that are not related to KafkaBut this would break the previous version as users would have to move from getProperties()
to getKafkaProperties()
and would have to look for properties either on kafkaProperties
or applicationProperties
.
kafka.properties needs to be kept isolated to:
I think the option 2 would just offer the simplest approach:
KafkaStreamsExecutionContext
can expose a getKafkaProperties()
in addition to the getProperties()
which only return the Kafka properties. Useful to instantiate the Kafka Streams
Problem
KStreamplify reads all configurations from the Spring Boot context and exposes those under the kafka.properties prefix in a static global object, KafkaStreamsExecutionContext.
protected void initProperties() { properties = PropertiesUtils.loadProperties(); serverPort = (Integer) properties.get(SERVER_PORT_PROPERTY); kafkaProperties = PropertiesUtils.loadKafkaProperties(properties); KafkaStreamsExecutionContext.registerProperties(kafkaProperties); }
Suggestion
I would like to be able to access all my properties through this object to manage some business or technical aspects that are not directly related to Kafka from my external configuration. Typically, a Kafka Streams application developed with KStreamplify uses Processor or Transformer classes, which are not directly managed by the Spring Application Context.
Alternatives Considered
Possible alternatives for implementation include: