package Ġno . nav . f amil ie . til b ake . be handling . consumer Ċ Ċ import Ġno . nav . f amil ie . til b ake . be handling . H ent F ags ystem s be handling Service Ċ import Ġno . nav . f amil ie . til b ake . config . Kafka Config Ċ import Ġorg . apache . kafka . clients . consumer . Consumer Record Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . context . annotation . Profile Ċ import Ġorg . springframework . kafka . annotation . Kafka Listener Ċ import Ġorg . springframework . kafka . support . Ack nowled gment Ċ import Ġorg . springframework . stereotype . Service Ċ import Ġjava . util . UUID Ċ import Ġjava . util . concurrent . Count DownLatch Ċ Ċ @ Service Ċ @ Profile (" ! integr as jon st est Ġ& Ġ! e 2 e ") Ċ class ĠH ent F ags ystem s be handling Respons Consumer ( private Ġval Ġf ags ystem s be handling Service : ĠH ent F ags ystem s be handling Service ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĠĠĠ Ġprivate Ġval Ġsecure Logger Ġ= ĠLoggerFactory . getLogger (" secure Logger ") ĊĊĠĠĠ Ġvar Ġl atch : ĠCount DownLatch Ġ= ĠCount DownLatch ( 1 ) ĊĊĊĠĠĠ Ġ@ Kafka Listener ( id Ġ= Ġ" f amil ie - til b ake ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtopics Ġ= Ġ[ Kafka Config . H ENT _ F AG SYSTEMS BE HAND LING _ RESP ONS _ TOPIC ], ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcontainer Factory Ġ= Ġ" concurrent Kafka Listener Container Factory ") ĊĠĠĠ Ġfun Ġlisten ( consumer Record : ĠConsumer Record < String , ĠString >, Ġack : ĠAck nowled gment ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlogger . info (" F ags ystem s be hand lings data Ġer Ġmot t att Ġi Ġkafka Ġ$ consumer Record ") ĊĠĠĠĠĠĠĠ Ġsecure Logger . info (" F ags ystem s be hand lings data Ġer Ġmot t att Ġi Ġkafka Ġ$ consumer Record ") ĊĊĠĠĠĠĠĠĠ Ġval ĠrequestId Ġ= ĠUUID . fromString ( consumer Record . key ()) ĊĠĠĠĠĠĠĠ Ġval Ġdata : ĠString Ġ= Ġconsumer Record . value () ĊĠĠĠĠĠĠĠ Ġf ags ystem s be handling Service . lag re H ent F ags ystem s be handling Respons ( requestId , Ġdata ) ĊĠĠĠĠĠĠĠ Ġl atch . count Down () ĊĠĠĠĠĠĠĠ Ġack . ack nowledge () ĊĠĠĠ Ġ} Ċ } Ċ