Created 11-24-2023 01:04 AM
i want to send value of kafka.topic as header i.e (the topic from where i consumed message) to publish topic (another topic) by using publish processor.
But iam getting below error in publish processor-
Created 11-24-2023 09:53 AM
The error tells you it needs to be a regular expression matching the attribute you wish to send so if it's kafka.topic it could be that literally or more accurately would be kafka\.topic
Created 11-26-2023 08:39 AM
kafka.topic is a key , it will have value of a kafka topic name e.g abc_xyz .
this value will keep on depending from where iam consuming the meassge , from which topic .
my requirement is to send the topic from where i consumed as header to the topic where iam publishing it .
how can i do that ??
Created 11-26-2023 05:54 PM
Yes, the regular expression it's asking for is that of the attribute containing the value you want... It's not asking for the value. Since you want the value of the attribute kafka.topic (name/key) then this is what the regular expression you need to match. Have you tried just putting what I previously recommended "kafka\.topic"?
Created 11-28-2023 05:45 AM
kafka\.topic , i tried adding this , but it did not work . I checked kafka headers too there also nothing being printed in haeder.
Created 11-28-2023 05:47 AM
@joseomjr Is on to the right solution here. Your regex statement should match "kafka.topic" not "${kafka.topic}". A quick test in regex101.com confirms "kafka\.topic" should match.