Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue Deployment #7

Open
joyguptaa opened this issue Jan 24, 2025 · 0 comments
Open

Queue Deployment #7

joyguptaa opened this issue Jan 24, 2025 · 0 comments
Assignees

Comments

@joyguptaa
Copy link
Contributor

joyguptaa commented Jan 24, 2025

How to Deploy Queue

Deployment Overview

The deployment process consists of two main steps:

  1. Deploy the Discord Queue with all necessary environment variables.
  2. Connect the Queue to the Consumer (i.e., the main.go application).

Note:
Once the Discord Queue is deployed (e.g., on port XXXX), you will connect the Consumer to that same port.

Step 1: Discord Queue Setup

The Discord Queue requires a RabbitMQ container. Below is the configuration for the docker-compose.yml file to build the RabbitMQ image:

version: '3.8'

services:
  rabbitmq:
    image: rabbitmq:3.13-management
    container_name: rabbitmq
    ports:
      - '5672:5672'   # AMQP protocol
      - '15672:15672' # Management UI (optional)

This configuration starts a RabbitMQ instance with the necessary ports exposed.

Step 2: Consumer Deployment

Prerequisite:

Ensure the Discord Queue (RabbitMQ) is already deployed and running.

Required Environment Variables:

  1. QUEUE_NAME: Set this to "STAGE_DISCORD_QUEUE".
  2. QUEUE_URL: Set this to amqp://:. If RabbitMQ is running on the default container name (rabbitmq), set it to amqp://rabbitmq:5672.
  3. DISCORD_SERVICE_URL : URL of Discord Service

Example docker-compose.yml for Consumer:

version: '3.8'

services:
  consumer:
    build: .
    container_name: consumer
    depends_on:
      - rabbitmq
    env_file:
      - .env

The consumer service depends on RabbitMQ and loads environment variables from a .env file, which should include the QUEUE_NAME and QUEUE_URL value

Final Step: Verification

Once both services (Queue and Consumer) are deployed, you can verify that by tailing logs of Consumer

That’s it! 🚀 With both images deployed, you should now have a fully functional setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants