I am getting the following error thrown when trying to use NServicebus with the Aws Sqs package in C#:
Amazon.SQS.AmazonSQSException: Can only include alphanumeric characters, hyphens, or underscores. 1 to 80 in length
This is because my queue is named samples_receive_test_queue.fifo
The .fifo extension is required when creating a message with the type FIFO using the AWS Management Console. I need a message queue of type FIFO so I do not receive duplicate messages when running my application with multiple pods in Kubernetes.
Does any one know if there a fix for this? Or a work around? The two rules contradict each other.
I do not believe you need a FIFO queue to support competing consumers. Topology • Amazon SQS Transport • Particular Docs
The main issue (and the reason you are getting an exception) is that the queue creator code in NServiceBus is not setting the FifoQueue
attribute when it sends the queue creation request. It only sets that attribute for the delayed delivery infrastructure queue which is named endpoint-name-delayed.fifo
. If you name your main queue endpoint-name.fifo
then the delayed delivery queue would end up named endpoint-name.fifo-delayed.fifo
and I’m not certain that’s legal.
I think instead of using a FIFO queue I need to use the NServiceBus Outbox functionality when coding for Sqs? It doesn’t really seem like Sqs handles distributed transactions or the possibility that a message can be received more than once? Also do you know if I have to physically delete an Sqs message after receiving it or does the NServiceBus message handler do that automatically? How is Outbox functionality turned on with .Net Core?
That’s correct. The outbox protects you from those things happening.
NServiceBus does all that for you.
Nothing special needs to be done. You need a storage option and a few configuration settings. More information is in our documentation: Outbox • NServiceBus • Particular Docs