ssut / nestjs-sqs

A project to make SQS easier to use within NestJS, with decorator-based handling and seamless NestJS-way integration.
MIT License
215 stars 53 forks source link

fix test e2e #7

Closed hdiaz-nectia closed 3 years ago

hdiaz-nectia commented 3 years ago

Reading documentation from softwaremill/elasticmq says, "While creating the FIFO queue, .fifo suffix will be added automatically to queue name.", so I change the file module.e2e-spec.ts like that:

const TestQueues: { [key in TestQueue]: SqsConsumerOptions | SqsProducerOptions } = {
  [TestQueue.Test]: {
    name: TestQueue.Test,
    queueUrl: `${SQS_ENDPOINT}/queue/test.fifo`,
    sqs,
  },
  [TestQueue.DLQ]: {
    name: TestQueue.DLQ,
    queueUrl: `${SQS_ENDPOINT}/queue/test-dead.fifo`,
    sqs,
  },
};

Also, since the queue test-dead is set up with fifo, we must change the name in deadLettersQueue section.

include classpath("application.conf")

akka.http.server.request-timeout = 30 seconds

queues {
    test {
        defaultVisibilityTimeout = 10 seconds
        delay = 0 seconds
        receiveMessageWait = 0 seconds
        deadLettersQueue {
            name = "test-dead.fifo"
            maxReceiveCount = 1          
        }
        fifo = true
        contentBasedDeduplication = false
        tags {
        }
    }
    test-dead {
      fifo = true
    }
}

Now it passed all test.

** without this change, an error is displayed when start the container and the last test fails.

docker run --rm --name elasticmq -p 9324:9324 -v "$PWD:/etc/elasticmq" s12v/elasticmq
20:45:49.353 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.15.8) ...
20:45:49.646 [main] ERROR org.elasticmq.server.QueueSorter$ - Dead letter queue test-dead not found
hdiaz-nectia commented 3 years ago

@ssut Can you help me checking this Pull Request.

hdiaz-nectia commented 3 years ago

@ssut There is a PR pending, please can you check it ?

hdiaz-nectia commented 3 years ago

@ssut There is a PR pending, Can you check it ?