Search code examples
spring-bootqueueaws-cliamazon-sqslocalstack

Value for parameter MessageDeduplicationId is invalid. Reason: The request includes a parameter that is not valid for this queue type


I have a queue in SQS running locally via Localstack. I already configured my .env to talk to my indexer and my api. But when I run it gives me this message:

Value I4nCE8HRz0M for parameter MessageDeduplicationId is 
invalid. Reason: The request includes a parameter that is 
not valid for this queue type.

I'm a bit confused as to what it could be since Localstack is running normally


Solution

  • Problem occurs because you're trying to send message to a FIFO queue, but you've created a standard queue. Instead of running command:

    LOCAL_STACK_CONTAINER.execInContainer("awslocal", "sqs", "create-queue", "--queue-name", QUEUE_NAME);
    

    You should run this one:

    LOCAL_STACK_CONTAINER.execInContainer("awslocal", "sqs", "create-queue", "--queue-name", QUEUE_NAME, "--attributes", "{\"FifoQueue\":\"true\"}");