CodexWorker

Backend Developer | Go, Microservices, Scalability

RabbitMQ Architecture Restructuring & Key Updates

What developments have taken place today?

Today’s work focused on significantly restructuring the RabbitMQ consumer architecture for increased modularity, testability, and maintainability. Key changes include:

This commit makes several changes related to RabbitMQ integration within the application. Here’s a breakdown of the modifications:

  1. RabbitMQ Configuration Updates: The Config struct now includes fields for various queues under the "rabbit_queues" section, centralizing queue names in configuration and the RabbitMQ struct accepts a RabbitMQ address during initialization.
  2. NewRabbitMQ Function: A new function NewRabbitMQ simplifies RabbitMQ instance creation by taking the RabbitMQ address as an argument, promoting code reusability.
  3. SendMessageToRabbitMQ Function Updates: The SendMessageToRabbitMQ function now takes a queue name and message body as inputs, making it more versatile. It uses the provided queue name to declare and publish messages to the correct RabbitMQ queues, with improved error handling via logging.
  4. InsertWebsiteUrlToRabbitMQ Function: This function remains largely unchanged but now leverages the NewRabbitMQ function for RabbitMQ instance creation, improving code clarity. It also uses the correct queue name from configuration.
  5. Changes in Consumer Logic (Checker & Lighthouse): The StartCheckerConsumer and CheckLightHouse functions were updated to use the new NewRabbitMQ function to instantiate RabbitMQ clients and send messages to appropriate queues based on configuration settings.
  6. Email Verification and Registration Handler Changes: The StartCertificateC function was updated to utilize the new RabbitMQ consumer structure and message publishing logic when sending email verification messages.

This commit modifies the code related to displaying website expiration information in a table.

Here’s a breakdown of the changes:

This commit refactors the code to improve certificate expiration handling within the CertificateConsumer.

Specifically, it replaces the helper_domain.NewDomain function with a new one that takes a WhoisClient and CertificateFetcher as arguments. The NewDomain function now injects

rabbitmq consumer architecture refactoring json serialization configuration updates api response certificate expiration