Class UserPublisher

java.lang.Object
dev.fernando.user_authentication_api.publisher.UserPublisher

@Component public class UserPublisher extends Object
Publisher class for sending user-related events to RabbitMQ. This class is responsible for publishing user creation events, email notifications, and user credentials to the appropriate RabbitMQ exchanges and queues.
Since:
1.0.0
Author:
Fernando Cruz Cavina
  • Constructor Details

    • UserPublisher

      public UserPublisher(org.springframework.amqp.rabbit.core.RabbitTemplate rabbitTemplate)
  • Method Details

    • publishUserEvent

      public void publishUserEvent(UserEventDto userEventDto, CreationType creationType)
      Publishes a message to the account creation in account-microservice.
      Parameters:
      userEventDto - the user event data to be published
      creationType - the type of creation event (e.g., CREATE, UPDATE)
    • publishMessageEmail

      public void publishMessageEmail(User createdUser)
      Publishes an email message to the email queue for a newly created user.
      Parameters:
      createdUser - the user whose email will be sent
    • publishAccountCreation

      public void publishAccountCreation(Long userId)
      Publishes a message to the account creation in email-sender-microservice with the user ID.
      Parameters:
      userId - the ID of the user for whom the account will be created
    • publishUserCredentials

      public void publishUserCredentials(AuthUserDto authUserDto)
      Publishes user credentials to the authentication microservice with email and password.
      Parameters:
      authUserDto - the authentication data to be sent