Integrate Redis for message queue handling and update the email service to process messages asynchronously. This was done to reduce the overhead caused by trips to the database.
What did you do?
Added Redis connection configuration in ConfigureInfrastructure.cs.
Implemented MessageQueueHandlerService to handle email queue messages using Redis pub/sub.
Updated MessageQueueService to publish email messages to the Redis queue.
Added new classes and methods to convert Message objects to Email records and vice versa.
Modified project files to include Redis dependencies and updated service registration.
Check List (Check all the applicable boxes)
[x] My code follows the code style of this project.
[x] This PR does not contain plagiarized content.
[x] The title and description of the PR are clear and explain the approach.
[x] I am making a pull request against the dev branch (left side).
[x] My commit message style matches the requested structure.
[x] My code additions will pass both code linting checks and unit tests.
[x] I am only making changes to files I was requested to.
Description
This pull request integrates Redis into the infrastructure and enhances the email service by adding a message queue handler. The changes support the efficient processing of emails through a pub/sub pattern. Closes hng_boilerplate_nextjs#1486 hng_boilerplate_nextjs#1489 hng_boilerplate_nextjs#1492 hng_boilerplate_nextjs#1493 hng_boilerplate_nextjs#1495 hng_boilerplate_nextjs#1499 hng_boilerplate_nextjs#1501 hng_boilerplate_nextjs#1502
Changes proposed
What were you told to do?
Integrate Redis for message queue handling and update the email service to process messages asynchronously. This was done to reduce the overhead caused by trips to the database.
What did you do?
ConfigureInfrastructure.cs
.MessageQueueHandlerService
to handle email queue messages using Redis pub/sub.MessageQueueService
to publish email messages to the Redis queue.Message
objects toEmail
records and vice versa.Check List (Check all the applicable boxes)
Screenshots/Videos
N/A