Class KafkaProducer
java.lang.Object
callofproject.dev.project.config.kafka.KafkaProducer
This class represents a Kafka producer service responsible for sending messages to a Kafka topic.
-
Constructor Summary
ConstructorsConstructorDescriptionKafkaProducer(org.apache.kafka.clients.admin.NewTopic topic, org.springframework.kafka.core.KafkaTemplate<String, ProjectParticipantNotificationDTO> kafkaTemplate) Constructs a new KafkaProducer with the provided dependencies. -
Method Summary
Modifier and TypeMethodDescriptionvoidSends a ProjectParticipantNotificationDTO message to the 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
Sends a ProjectParticipantNotificationDTO message to the Kafka topic.- Parameters:
message- The message to send.
-