package Ġno . nav . f amil ie . ef . mot tak . config Ċ Ċ import Ġio . con fluent . kafka . serializers . Kafka Av ro Serializer Ċ import Ġio . con fluent . kafka . serializers . Kafka Av ro Serializer Config Ċ import Ġno . nav . br uk er not ifik as jon . schemas . B es kj ed Ċ import Ġno . nav . br uk er not ifik as jon . schemas . N ok kel Ċ import Ġorg . apache . kafka . clients . Common Client Configs Ċ import Ġorg . apache . kafka . clients . producer . Producer Config Ċ import Ġorg . apache . kafka . common . config . S asl Configs Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . kafka . annotation . Enable Kafka Ċ import Ġorg . springframework . kafka . core . Default Kafka Producer Factory Ċ import Ġorg . springframework . kafka . core . Kafka Template Ċ import Ġorg . springframework . kafka . core . Producer Factory Ċ import Ġorg . springframework . kafka . support . Logging Producer Listener Ċ Ċ /** Ċ Ġ* ĠConfig Ġfor ĠÃ¥ Ġn Ã¥ Ġbru ker not ifik as jon Ġtopic Ġsom Ġfort s att Ġer Ġon - prem . ĠDen ne Ġklass en Ġkan Ġf j ern es Ġn Ã¥r Ġtopic Ġer Ġk lar Ġi Ġa iven Ġi Ġprod . Ċ */ Ċ @ Enable Kafka Ċ @ Configuration Ċ class ĠD itt Nav Kafka Config ( ĊĠĠĠ Ġ@ Value ("\ ${ K AF KA _ ON PRE M _ BOOT STR AP _ SERVER S }") ĊĠĠĠ Ġprivate Ġval Ġbootstrap Servers : ĠString , ĊĠĠĠ Ġ@ Value ("\ ${ K AF KA _ ON PRE M _ SCHEMA _ REGISTRY _ URL }") ĊĠĠĠ Ġprivate Ġval Ġschema Registry Url : ĠString , ĊĠĠĠ Ġ@ Value ("\ ${ SERVICE _ USER _ USERNAME }") ĊĠĠĠ Ġprivate Ġval Ġusername : ĠString , ĊĠĠĠ Ġ@ Value ("\ ${ SERVICE _ USER _ PASSWORD }") ĊĠĠĠ Ġprivate Ġval Ġpassword : ĠString Ċ ) Ġ{ ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġproducer Configs (): ĠMap < String , ĠAny > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġprops : ĠMutable Map < String , ĠAny > Ġ= ĠHashMap () ĊĠĠĠĠĠĠĠ Ġprops [ Producer Config . BOOT STR AP _ SERVER S _ CONFIG ] Ġ= Ġbootstrap Servers ĊĠĠĠĠĠĠĠ Ġprops [ Producer Config . KEY _ SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠKafka Av ro Serializer :: class . java ĊĠĠĠĠĠĠĠ Ġprops [ Producer Config . VALUE _ SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠKafka Av ro Serializer :: class . java ĊĠĠĠĠĠĠĠ Ġprops [ Producer Config . ACK S _ CONFIG ] Ġ= Ġ" all " ĊĠĠĠĠĠĠĠ Ġprops [ Producer Config . CLIENT _ ID _ CONFIG ] Ġ= Ġusername ĊĠĠĠĠĠĠĠ Ġprops [ Kafka Av ro Serializer Config . SCHEMA _ REGISTRY _ URL _ CONFIG ] Ġ= Ġschema Registry Url ĊĠĠĠĠĠĠĠ Ġprops [ S asl Configs . SAS L _ JA AS _ CONFIG ] Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" org . apache . kafka . common . security . plain . Plain Login Module Ġrequired Ġusername =\" $ username \" Ġpassword =\" $ password \"; " ĊĠĠĠĠĠĠĠ Ġprops [ S asl Configs . SAS L _ ME CHAN IS M ] Ġ= Ġ" PLAIN " ĊĠĠĠĠĠĠĠ Ġprops [ Common Client Configs . SECURITY _ PROTOCOL _ CONFIG ] Ġ= Ġ" SAS L _ SSL " ĊĊĠĠĠĠĠĠĠ Ġreturn Ġprops ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġproducer Factory (): ĠProducer Factory < N ok kel , ĠBes kj ed > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠDefault Kafka Producer Factory ( producer Configs ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġkafka Template (): ĠKafka Template < N ok kel , ĠBes kj ed > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠKafka Template ( producer Factory ()). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġproducer Listener Ġ= ĠLogging Producer Listener < String , ĠString >() ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproducer Listener . set Include Contents ( false ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }