azure-functions-kafka-extension
azure-functions-kafka-extension copied to clipboard
Parameterizing Annotations
Hi,
First, my last issue was about having problems adding the kafka extension this one was addressed by down grading the dotnet runtime from 5 to 3 which is ok.
Right now I ned to parameterizing annotations in order to work in different environments. Is ther a way to accomplish this -by having properties files or sommetyhing-?
@KafkaOutput( name = "kafkaOutput", topic = "the-topic", <-- must be dynamic brokerList="broker:000",<-- must be dynamic username="user", <-- must be dynamic password="passwd", <-- must be dynamic protocol=BrokerProtocol.SASLSSL, dataType="string", authenticationMode=BrokerAuthenticationMode.SCRAMSHA512, sslCertificateLocation="/kafka.pem", sslCaLocation="/kafka.pem"
Thanks in advance
Hi @nachoge We can use the appsetting to configure these parameters, however, we can't change it dynamically.
If you want to sore these data on appsettings or local.settings.json. For brokerList is already support the appsettings, so that if you write borkerList="borker" then you can configure appsettings or local.settings.json like this.
This is an example. https://github.com/TsuyoshiUshio/KafkaTemplateSamples/blob/eventHubs/Java/src/main/java/com/contoso/kafka/FunctionOutput.java