Regex Patterns to Match Topics? #309
Replies: 2 comments
-
@derekrprice, could you provide more details what exactly are you looking for ?? |
Beta Was this translation helpful? Give feedback.
-
All the Kafka clients I have looked up support subscribing to all topics matching a user-specified regular expression (see the docs for the JS client and the .NET client). For example, we have topics under For example, something like this in a {
"bindings": [
{
"type": "kafkaTrigger",
"name": "event",
"direction": "in",
"dataType" : "json",
"topicRegex" : "/^devices\\/(\\d+)\\/state\\/(\\w+)$/",
"consumerGroup" : "mongo-sync",
"username": "%ConfluentCloudUserName%",
"password": "%ConfluentCloudPassword%",
"protocol": "saslSsl",
"authenticationMode": "plain",
"brokerList": "%BrokerList%"
}
]
} Not sure if this is a separate ask, but I would need the matched topic and key of the matched event included in either the event or the context as well. At the moment, I believe that only the event text is being included. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Just wondering if the functions kafka trigger supports regex patterns in lieu of a topic name like most kafka consumers. I can't find anything in the docs on what that syntax might look like. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions