Error Sending Variables to Kafka Producer Dynamically

I need to be able to send variables to kafka dynamically similarly to other resources, where you can pass in the variables dynamically

when i try to produce to kafka topic, it is taking the variables as a literal string instead of filling the values causing this error

Invalid JSON for producer: { "domain": {{ domain }} , "run_id": {{ run_id }} }


I have even tried using variables as intermediates and am still getting the same error, the only way i have been able to send a msg to a topic is by "hard coding" the value