Class KafkaProducer

java.lang.Object
callofproject.dev.project.config.kafka.KafkaProducer

@Service public class KafkaProducer extends Object
This class represents a Kafka producer service responsible for sending messages to a Kafka topic.
  • Constructor Details

    • KafkaProducer

      public KafkaProducer(org.apache.kafka.clients.admin.NewTopic topic, org.springframework.kafka.core.KafkaTemplate<String,ProjectParticipantNotificationDTO> kafkaTemplate)
      Constructs a new KafkaProducer with the provided dependencies.
      Parameters:
      topic - The NewTopic instance representing the Kafka topic to send messages to.
      kafkaTemplate - The KafkaTemplate instance for sending messages to the Kafka topic.
  • Method Details

    • sendProjectParticipantNotification

      public void sendProjectParticipantNotification(ProjectParticipantNotificationDTO message)
      Sends a ProjectParticipantNotificationDTO message to the Kafka topic.
      Parameters:
      message - The message to send.