Sample code to publish a message to a topic using spring cloud stream api

I’m not aware on how to generate a common class like that. My other sample are using Supplier but still has has the topic name defined in the app yaml file.