package Ġno . nav . e ess i . pens jon . config Ċ Ċ import Ġorg . apache . kafka . clients . Common Client Configs Ċ import Ġorg . apache . kafka . clients . consumer . Consumer Config Ċ import Ġorg . apache . kafka . common . config . Ssl Configs Ċ import Ġorg . apache . kafka . common . serialization . String Deserializer Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . context . annotation . Profile Ċ import Ġorg . springframework . kafka . annotation . Enable Kafka Ċ import Ġorg . springframework . kafka . config . Concurrent Kafka Listener Container Factory Ċ import Ġorg . springframework . kafka . core . Consumer Factory Ċ import Ġorg . springframework . kafka . core . Default Kafka Consumer Factory Ċ import Ġorg . springframework . kafka . listener . Container Properties Ċ import Ġjava . time . Duration Ċ Ċ @ Enable Kafka Ċ @ Profile (" test ", Ġ" prod ") Ċ @ Configuration Ċ class ĠKafka Config ( ĊĠĠĠ Ġ@ param : Value ("\ ${ kafka . keystore . path }") Ġprivate Ġval Ġkeystore Path : ĠString , ĊĠĠĠ Ġ@ param : Value ("\ ${ kafka . cred store . password }") Ġprivate Ġval Ġcred store Password : ĠString , ĊĠĠĠ Ġ@ param : Value ("\ ${ kafka . trust store . path }") Ġprivate Ġval Ġtrust store Path : ĠString , ĊĠĠĠ Ġ@ param : Value ("\ ${ kafka . bro kers }") Ġprivate Ġval Ġa iven Bootstrap Servers : ĠString , ĊĠĠĠ Ġ@ param : Value ("\ ${ kafka . security . protocol }") Ġprivate Ġval Ġsecurity Protocol : ĠString , Ċ ) Ġ{ ĊĊĠĠĠ Ġfun Ġa iven Kafka Consumer Factory (): ĠConsumer Factory < String , ĠString > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġconfig Map : ĠMutable Map < String , ĠAny > Ġ= ĠHashMap () ĊĠĠĠĠĠĠĠ Ġpop uler A iven Common Config ( config Map ) ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . CLIENT _ ID _ CONFIG ] Ġ= Ġ" e ess i - pens jon - kr av - initial is ering " ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . BOOT STR AP _ SERVER S _ CONFIG ] Ġ= Ġa iven Bootstrap Servers ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . ENABLE _ AUTO _ COMMIT _ CONFIG ] Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . AUTO _ OFFSET _ RESET _ CONFIG ] Ġ= Ġ" ear liest " ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . MAX _ POLL _ RECORD S _ CONFIG ] Ġ= Ġ 1 ĊĠĠĠĠĠĠĠ Ġreturn ĠDefault Kafka Consumer Factory ( config Map , ĠString Deserializer (), ĠString Deserializer ()) ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġa iven Kafka Listener Container Factory (): ĠConcurrent Kafka Listener Container Factory < String , ĠString >? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Ġ= ĠConcurrent Kafka Listener Container Factory < String , ĠString >() ĊĠĠĠĠĠĠĠ Ġfactory . consumer Factory Ġ= Ġa iven Kafka Consumer Factory () ĊĠĠĠĠĠĠĠ Ġfactory . container Properties . ack Mode Ġ= ĠContainer Properties . Ack Mode . MAN UAL ĊĠĠĠĠĠĠĠ Ġfactory . container Properties . set Auth Exception Retry Interval ( Duration . of Seconds ( 4 L )) ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġpop uler A iven Common Config ( config Map : ĠMutable Map < String , ĠAny >) Ġ{ ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ KEY STORE _ LOCATION _ CONFIG ] Ġ= Ġkeystore Path ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ TR UST STORE _ PASSWORD _ CONFIG ] Ġ= Ġcred store Password ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ KEY STORE _ PASSWORD _ CONFIG ] Ġ= Ġcred store Password ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ KEY _ PASSWORD _ CONFIG ] Ġ= Ġcred store Password ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ TR UST STORE _ TYPE _ CONFIG ] Ġ= Ġ" J KS " ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ KEY STORE _ TYPE _ CONFIG ] Ġ= Ġ" PKCS 1 2 " ĊĠĠĠĠĠĠĠ Ġconfig Map [ Ssl Configs . SSL _ TR UST STORE _ LOCATION _ CONFIG ] Ġ= Ġtrust store Path ĊĠĠĠĠĠĠĠ Ġconfig Map [ Common Client Configs . SECURITY _ PROTOCOL _ CONFIG ] Ġ= Ġsecurity Protocol ĊĠĠĠ Ġ} Ċ }