Skip to content
Snippets Groups Projects
Commit 41c94097 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Interpret topic names as a regex string

parent 8b644956
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!133Allow to delete all topics that have a specific prefix,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
...@@ -27,5 +27,5 @@ kafkaConfig: ...@@ -27,5 +27,5 @@ kafkaConfig:
- name: "input" - name: "input"
numPartitions: 40 numPartitions: 40
replicationFactor: 1 replicationFactor: 1
- name: "theodolite" - name: "theodolite-.*"
removeOnly: True removeOnly: True
\ No newline at end of file
...@@ -30,4 +30,6 @@ kafkaConfig: ...@@ -30,4 +30,6 @@ kafkaConfig:
topics: topics:
- name: "input" - name: "input"
numPartitions: 40 numPartitions: 40
replicationFactor: 1 replicationFactor: 1
\ No newline at end of file - name: "theodolite-.*"
removeOnly: True
\ No newline at end of file
...@@ -70,7 +70,7 @@ class TopicManager(private val kafkaConfig: Map<String, Any>) { ...@@ -70,7 +70,7 @@ class TopicManager(private val kafkaConfig: Map<String, Any>) {
*/ */
private fun matchRegex(existingTopic: String, topics: List<String>): Boolean { private fun matchRegex(existingTopic: String, topics: List<String>): Boolean {
for (t in topics) { for (t in topics) {
val regex = ("$t.*").toRegex() val regex = t.toRegex()
if (regex.matches(existingTopic)) { if (regex.matches(existingTopic)) {
return true return true
} }
......
...@@ -27,5 +27,5 @@ kafkaConfig: ...@@ -27,5 +27,5 @@ kafkaConfig:
- name: "input" - name: "input"
numPartitions: 40 numPartitions: 40
replicationFactor: 1 replicationFactor: 1
- name: "theodolite" - name: "theodolite-.*"
removeOnly: True removeOnly: True
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment