Class UserPublisher
java.lang.Object
dev.fernando.user_authentication_api.publisher.UserPublisher
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 Summary
ConstructorsConstructorDescriptionUserPublisher
(org.springframework.amqp.rabbit.core.RabbitTemplate rabbitTemplate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
publishAccountCreation
(Long userId) Publishes a message to the account creation in email-sender-microservice with the user ID.void
publishMessageEmail
(User createdUser) Publishes an email message to the email queue for a newly created user.void
publishUserCredentials
(AuthUserDto authUserDto) Publishes user credentials to the authentication microservice with email and password.void
publishUserEvent
(UserEventDto userEventDto, CreationType creationType) Publishes a message to the account creation in account-microservice.
-
Constructor Details
-
UserPublisher
public UserPublisher(org.springframework.amqp.rabbit.core.RabbitTemplate rabbitTemplate)
-
-
Method Details
-
publishUserEvent
Publishes a message to the account creation in account-microservice.- Parameters:
userEventDto
- the user event data to be publishedcreationType
- the type of creation event (e.g., CREATE, UPDATE)
-
publishMessageEmail
Publishes an email message to the email queue for a newly created user.- Parameters:
createdUser
- the user whose email will be sent
-
publishAccountCreation
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
Publishes user credentials to the authentication microservice with email and password.- Parameters:
authUserDto
- the authentication data to be sent
-