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 . clients . producer . Producer 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 . 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 .* Ċ import Ġorg . springframework . kafka . listener . Container Properties Ċ import Ġjava . time . Duration ĊĊ Ċ @ Enable Kafka Ċ @ Profile (" integration test ") Ċ @ Configuration Ċ class ĠKafka Config Integration test ( ĊĠĠĠ Ġ@ param : Value ("\ ${ spring . embedded . kafka . bro kers }") Ġprivate Ġval Ġbootstrap Servers : ĠString ) Ġ{ ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġa iven Producer Factory (): ĠProducer Factory < String , ĠString > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġconfig Map : ĠMutable Map < String , ĠAny > Ġ= ĠHashMap () ĊĠĠĠĠĠĠĠ Ġpop uler Common Config ( config Map ) ĊĠĠĠĠĠĠĠ Ġconfig Map [ Producer Config . CLIENT _ ID _ CONFIG ] Ġ= Ġ" e ess i - pens jon - stat ist ikk " ĊĠĠĠĠĠĠĠ Ġconfig Map [ Producer Config . KEY _ SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠString Serializer :: class . java ĊĠĠĠĠĠĠĠ Ġconfig Map [ Producer Config . VALUE _ SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠString Serializer :: class . java ĊĠĠĠĠĠĠĠ Ġconfig Map [ Producer Config . BOOT STR AP _ SERVER S _ CONFIG ] Ġ= Ġbootstrap Servers ĊĊĠĠĠĠĠĠĠ Ġreturn ĠDefault Kafka Producer Factory ( config Map ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġkafka Consumer Factory (): ĠConsumer Factory < String , ĠString > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġconfig Map : ĠMutable Map < String , ĠAny > Ġ= ĠHashMap () ĊĠĠĠĠĠĠĠ Ġpop uler Common Config ( config Map ) ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . CLIENT _ ID _ CONFIG ] Ġ= Ġ" e ess i - pens jon - stat ist ikk " ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . KEY _ DE SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠString Deserializer :: class . java ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . VALUE _ DE SERIAL IZER _ CLASS _ CONFIG ] Ġ= ĠString Deserializer :: class . java ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . BOOT STR AP _ SERVER S _ CONFIG ] Ġ= Ġbootstrap Servers ĊĠĠĠĠĠĠĠ Ġconfig Map [ Consumer Config . ENABLE _ AUTO _ COMMIT _ CONFIG ] Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠ Ġreturn ĠDefault Kafka Consumer Factory ( config Map ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġon prem Kafka Listener Container Factory (): ĠConcurrent Kafka Listener Container Factory < String , ĠString >? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Ġ= ĠConcurrent Kafka Listener Container Factory < String , ĠString >() ĊĠĠĠĠĠĠĠ Ġfactory . consumer Factory Ġ= Ġkafka Consumer Factory () ĊĠĠĠĠĠĠĠ Ġfactory . container Properties . ack Mode Ġ= ĠContainer Properties . Ack Mode . MAN UAL ĊĠĠĠĠĠĠĠ Ġfactory . container Properties . authorization Exception Retry Interval Ġ= Ġ ĠDuration . of Seconds ( 4 L ) ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġa iven Kafka Template (): ĠKafka Template < String , ĠString > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠKafka Template ( a iven Producer Factory ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ 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 Ġ= Ġkafka Consumer Factory () ĊĠĠĠĠĠĠĠ Ġfactory . container Properties . ack Mode Ġ= ĠContainer Properties . Ack Mode . MAN UAL ĊĠĠĠĠĠĠĠ Ġfactory . container Properties . authorization Exception Retry Interval Ġ= Ġ ĠDuration . of Seconds ( 4 L ) ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġpop uler Common Config ( config Map : ĠMutable Map < String , ĠAny >) Ġ{ ĊĠĠĠĠĠĠĠ Ġconfig Map [ Common Client Configs . SECURITY _ PROTOCOL _ CONFIG ] Ġ= Ġ" PL AINT EXT " ĊĠĠĠ Ġ} Ċ }