-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
C# requires that attribute arguments must be a constant expression, typeof expression, or array creation expression of an attribute parameter type, which makes putting the Protocol and AuthenticationMode arguments for both KafkaTriggerAttribute and KafkaAttribute in to *.settings.json files impossible.
In code you can do something like:
BrokerProtocol protocol = (BrokerProtocol)Enum.Parse(typeof(BrokerProtocol), @"%Sec_Protocol%");but, that doesn't work for Attribute arguments.
It would be fantastic if KafkaTriggerAttribute and KafkaAttribute added string attribute versions of Protocol and AuthenticationMode that internally do the Enum.Parse() so that these values can be populated as:
[KafkaTrigger(@"%Broker%",
@"%TopicName%",
SslCaLocation = @"%CaFile%",
Protocol = @"%Protocol%", // <-----
AuthenticationMode = @"%AuthMode%", // <-----
Username = @"%Username%",
Password = @"%Password%",
ConsumerGroup = "%ConsumerGroup%" )] KafkaEventData<byte[]>[] events,instead of hardcoded like:
[KafkaTrigger(@"%Broker%",
@"%TopicName%",
SslCaLocation = @"%CaFile%",
Protocol = BrokerProtocol.SaslSsl, // <-----
AuthenticationMode = BrokerAuthenticationMode.Plain, // <-----
Username = @"%Username%",
Password = @"%Password%",
ConsumerGroup = "%ConsumerGroup%" )] KafkaEventData<byte[]>[] events,dwoldo, gliljas, lilleman12, vavsab, arkiaconsulting and 2 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request