copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Can't subscribe to SQS queues in Load Balanced Web Service

Open wub opened this issue 1 year ago • 7 comments

Hi, I have two services:

  1. Service A (Load Balanced Web Service)
  2. Service B (Worker Service)

Service A has the following config in its manifest:

publish:
  topics:
    - name: foo_requests

# You can register to topics from other services.
# The events can be received from an SQS queue via the env var $COPILOT_QUEUE_URI.
subscribe:
  topics: 
    - name: foo_responses
      service: service_b

Service B has the following config in its manifest:

publish:
  topics:
    - name: foo_responses

subscribe:
  topics: 
    - name: foo_requests
      service: service_a

In Service B, the Worker, I have all the required SNS/SQS running, and the environment variables have been set:

COPILOT_QUEUE_URI=https://sqs.ap-x.amazonaws.com/xxx/x-EventsQueue-xxx
COPILOT_SNS_TOPIC_ARNS={"foo_responses":"arn:aws:sns:xxx:xxxxx:xxxx-foo_responses"}

In Service A, the Load Balanced Web Service, I don't get COPILOT_QUEUE_URI (it doesn't seem to ever be created). However, SNS is connected correctly:

COPILOT_SNS_TOPIC_ARNS={"foo_requests":"arn:aws:sns:xxx:xxxxx:xxxx-foo_requests"}

Is it intentional that Load Balanced Web Services can't subscribe to SQS queues? Or am I doing something wrong? Thank you.

wub avatar Mar 16 '23 01:03 wub