Reputation: 387
I'm using Kafa connect solr and I'm trying to find a way to change the solr url based on the passed in topic, I've been looking at Kafka connect_transforms to try and achieve this. My connect properties file looks like this -
topics.regex=foo.*.bar
solr.url=http://127.0.0.1:8910/solr/RemoveString$Value
transforms=RemoveString
transforms.RemoveString.type=org.apache.kafka.connect.transforms.RegexRouter
transforms.RemoveString.regex=(^foo.)(\w*\d+)(.*)
transforms.RemoveString.replacement=$2
How can i use the RemoveString value in the solr.url property?
Upvotes: 0
Views: 310
Reputation: 191723
transforms
really only alter the Kafka Record itself, not external properties such as the clients that the Connect tasks may use
Specifically, look at the source code, and you'll see that it uses topic names to map to individual clients, but all at the same url
Upvotes: 1