package Ġno . nav . hel se Ċ Ċ import Ġcom . fasterxml . jackson . databind . ObjectMapper Ċ import Ġcom . fasterxml . jackson . databind . Serialization Feature Ċ import Ġcom . fasterxml . jackson . datatype . js r 3 1 0 . Java Time Module Ċ import Ġcom . fasterxml . jackson . module . kotlin . jackson ObjectMapper Ċ import Ġio . ktor . client . HttpClient Ċ import Ġio . ktor . client . features . json . Jack son Serializer Ċ import Ġio . ktor . client . features . json . Json Feature Ċ import Ġno . nav . hel se . rap ids _ river s . R apid Application Ċ import Ġno . nav . hel se . rap ids _ river s . R ap ids Connection Ċ import Ġorg . apache . kafka . clients . producer . Kafka Producer Ċ import Ġjava . util . Properties Ċ Ċ internal Ġval ĠobjectMapper : ĠObjectMapper Ġ= Ġj ack son ObjectMapper () ĊĠĠĠ Ġ. disable ( Serialization Feature . WRITE _ DAT ES _ AS _ TIMESTAMP S ) ĊĠĠĠ Ġ. register Module ( Java Time Module ()) Ċ Ċ fun Ġmain () Ġ{ ĊĠĠĠ Ġval Ġservice User Ġ= Ġread Service User Credentials () ĊĠĠĠ Ġval Ġrap ids Connection Ġ= Ġlaunch Application ( System . getenv (), Ġservice User ) ĊĠĠĠ Ġrap ids Connection . start () Ċ } Ċ Ċ fun Ġlaunch Application ( ĊĠĠĠ Ġenvironment : ĠMap < String , ĠString >, ĊĠĠĠ Ġservice User : ĠService User Ċ ): ĠR ap ids Connection Ġ{ ĊĠĠĠ Ġval Ġkafka Config : ĠProperties Ġ= ĠTODO () ĊĠĠĠ Ġval Ġle es ah Producer Ġ= ĠKafka Producer < String , ĠString >( kafka Config ) ĊĊĠĠĠ Ġreturn ĠR apid Application . create ( environment ). apply Ġ{ ĊĠĠĠĠĠĠĠ ĠU tb et aling Event Message ( this , Ġle es ah Producer ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun Ġsimple HttpClient ( serializer : ĠJack son Serializer ? Ġ= ĠJack son Serializer ()) Ġ= ĠHttpClient () Ġ{ ĊĠĠĠ Ġinstall ( Json Feature ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . serializer Ġ= Ġserializer ĊĠĠĠ Ġ} Ċ } Ċ