package Ġv dt . hospital . notification Ċ Ċ import Ġio . con fluent . kafka . serializers . Kafka Av ro Deserializer Ċ import Ġorg . apache . kafka . clients . consumer . Consumer Config Ċ import Ġorg . apache . kafka . common . serialization . String Deserializer Ċ import Ġorg . apache . kafka . common . serialization . String Serializer Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . boot . autoconfigure . kafka . Kafka Properties Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . kafka . annotation . Enable Kafka Ċ import Ġorg . springframework . kafka . core . Consumer Factory Ċ import Ġorg . springframework . kafka . core . Default Kafka Consumer Factory Ċ import Ġjava . util .* Ċ import Ġorg . springframework . kafka . config . Concurrent Kafka Listener Container Factory ĊĊĊĊ Ċ @ Configuration Ċ @ Enable Kafka Ċ class ĠKafka Config ( ĊĠĠĠ Ġ@ Value ("\ ${ kafka . config . bootstrap - servers }") Ġval Ġbootstrap Servers : ĠString , ĊĠĠĠ Ġ@ Value ("\ ${ kafka . consumer . group - id }") Ġval Ġconsumer GroupId : ĠString , ĊĠĠĠ Ġ@ Value ("\ ${ kafka . consumer . auto - offset - reset }") Ġval Ġauto Offset Reset : ĠString , Ċ ) Ġ{ ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġkafka Listener Container Factory (): ĠConcurrent Kafka Listener Container Factory < String , ĠString >? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Ġ= ĠConcurrent Kafka Listener Container Factory < String , ĠString >() ĊĠĠĠĠĠĠĠ Ġfactory . consumer Factory Ġ= Ġconsumer Factory () ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġconsumer Factory (): ĠConsumer Factory < String , ĠString > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠDefault Kafka Consumer Factory ( consumer Props ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġconsumer Props (): ĠMap < String , ĠAny > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġprops : ĠMutable Map < String , ĠAny > Ġ= ĠHashMap () ĊĠĠĠĠĠĠĠ Ġprops [ Consumer Config . BOOT STR AP _ SERVER S _ CONFIG ] Ġ= Ġbootstrap Servers ĊĠĠĠĠĠĠĠ Ġprops [ Consumer Config . GROUP _ ID _ CONFIG ] Ġ= Ġconsumer GroupId ĊĠĠĠĠĠĠĠ Ġprops [ Consumer Config . KEY _ DE SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠString Deserializer :: class . java ĊĠĠĠĠĠĠĠ Ġprops [ Consumer Config . VALUE _ DE SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠKafka Av ro Deserializer :: class . java ĊĠĠĠĠĠĠĠ Ġprops [ Consumer Config . AUTO _ OFFSET _ RESET _ CONFIG ] Ġ= Ġauto Offset Reset ĊĠĠĠĠĠĠĠ Ġreturn Ġprops ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġlistener (): ĠKafka Properties . Listener Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠKafka Properties . Listener () ĊĠĠĠ Ġ} Ċ Ċ }