package Ġcom . example . customer . infra Ċ Ċ import Ġcom . example . customer . domain . Credit Limit Exceeded Event Ċ import Ġcom . example . customer . domain . Credit Reserved Event Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . amqp . rabbit . core . Rabbit Template Ċ import Ġorg . springframework . stereotype . Service Ċ Ċ @ Service Ċ class ĠEvent Sender ( val Ġrabbit Template : ĠRabbit Template ) Ġ{ ĊĊĠĠĠ Ġval Ġlog Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĊĠĠĠ Ġfun Ġpublish Credit Reserved Event ( event : ĠCredit Reserved Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog . info (" Publishing Ġ$ event ") ĊĠĠĠĠĠĠĠ Ġrabbit Template . convert And Send (" credit - reserved - queue ", Ġevent ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġpublish Credit Limit Exceeded Event ( event : ĠCredit Limit Exceeded Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog . info (" Publishing Ġ$ event ") ĊĠĠĠĠĠĠĠ Ġrabbit Template . convert And Send (" credit - limit - ex ceeded - queue ", Ġevent ) ĊĠĠĠ Ġ} Ċ Ċ }