package Ġorg . s ug gs . sandbox . events ourcing . kafka Ċ Ċ import Ġorg . apache . kafka . clients . producer . Kafka Producer Ċ import Ġorg . apache . kafka . clients . producer . Producer Ċ import Ġorg . apache . kafka . clients . producer . Producer Config Ċ import Ġjava . util .* Ċ Ċ class ĠKafka Producer Builder Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġproperties Ġ= ĠProperties () ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġa Kafka Producer () Ġ= ĠKafka Producer Builder () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġconnected To ( kafka Url : ĠString ) Ġ= Ġadd Properties And Return ( Producer Config . BOOT STR AP _ SERVER S _ CONFIG , Ġkafka Url ) ĊĠĠĠ Ġfun Ġknown As ( client Name : ĠString ) Ġ= Ġadd Properties And Return ( Producer Config . CLIENT _ ID _ CONFIG , Ġclient Name ) ĊĠĠĠ Ġfun Ġusing Key Serializer ( serializer Name : ĠString ?) Ġ= Ġadd Properties And Return ( Producer Config . KEY _ SERIAL IZER _ CLASS _ CONFIG , Ġserializer Name ) ĊĠĠĠ Ġfun Ġusing Value Serializer ( serializer Name : ĠString ?) Ġ= Ġadd Properties And Return ( Producer Config . VALUE _ SERIAL IZER _ CLASS _ CONFIG , Ġserializer Name ) ĊĊĠĠĠ Ġfun Ġ< K , ĠV > Ġbuild (): ĠProducer < K , ĠV > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠKafka Producer ( properties ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġadd Properties And Return ( a Key : ĠString , Ġa Value : ĠString ?): ĠKafka Producer Builder Ġ{ ĊĠĠĠĠĠĠĠ Ġproperties [ a Key ] Ġ= Ġa Value ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} Ċ }