Class KafkaConsumer
java.lang.Object
callofproject.dev.community.config.kafka.KafkaConsumer
- Author:
- Nuri Can ÖZTÜRK This class represents a Kafka consumer service responsible for listening to messages from a Kafka topic.
-
Constructor Summary
ConstructorsConstructorDescriptionKafkaConsumer(callofproject.dev.data.community.repository.IUserRepository userRepository, IUserMapper userMapper, callofproject.dev.data.community.repository.IProjectRepository projectRepository, callofproject.dev.data.community.dal.CommunityServiceHelper serviceHelper) Constructs a new KafkaConsumer with the provided dependencies. -
Method Summary
Modifier and TypeMethodDescriptionvoidconsumeProjectInfo(ProjectInfoKafkaDTO projectDTO) Listens to the specified Kafka topic and processes ProjectInfoKafkaDTO messages.voidListens to the specified Kafka topic and processes ProjectParticipantKafkaDTO messages.voidListens to the specified Kafka topic and processes UserDTO messages.
-
Constructor Details
-
KafkaConsumer
public KafkaConsumer(callofproject.dev.data.community.repository.IUserRepository userRepository, IUserMapper userMapper, callofproject.dev.data.community.repository.IProjectRepository projectRepository, callofproject.dev.data.community.dal.CommunityServiceHelper serviceHelper) Constructs a new KafkaConsumer with the provided dependencies.- Parameters:
userMapper- The IUserMapper instance used for mapping UserDTO messages.
-
-
Method Details
-
listenAuthenticationTopic
@KafkaListener(topics="${spring.kafka.user-topic-name}", groupId="${spring.kafka.consumer.user-group-id}", containerFactory="configUserKafkaListener") public void listenAuthenticationTopic(UserKafkaDTO dto) Listens to the specified Kafka topic and processes UserDTO messages.- Parameters:
dto- The UserDTO message received from Kafka.
-
consumeProjectInfo
@KafkaListener(topics="${spring.kafka.project-topic-name}", groupId="${spring.kafka.consumer.project-group-id}", containerFactory="configProjectInfoKafkaListener") public void consumeProjectInfo(ProjectInfoKafkaDTO projectDTO) Listens to the specified Kafka topic and processes ProjectInfoKafkaDTO messages.- Parameters:
projectDTO- The ProjectInfoKafkaDTO message received from Kafka.
-
consumeProjectParticipant
@KafkaListener(topics="${spring.kafka.project-participant-topic-name}", groupId="${spring.kafka.consumer.project-participant-group-id}", containerFactory="configProjectParticipantKafkaListener") @Transactional public void consumeProjectParticipant(ProjectParticipantKafkaDTO dto) Listens to the specified Kafka topic and processes ProjectParticipantKafkaDTO messages.- Parameters:
dto- The ProjectParticipantKafkaDTO message received from Kafka.
-