notifications-engine icon indicating copy to clipboard operation
notifications-engine copied to clipboard

Argo CD Notifications don't work properly with AWS SQS fifo queue

Open zahidzia opened this issue 1 year ago • 1 comments

I was trying to implement argo cd notifications to send messages on an AWS SQS fifo queue and it doesn't seem to work. In the notification controller log, I see the following error:

time="yyy-dd-mm" level=error msg="Got an error sending the message: operation error SQS: SendMessage, https response error StatusCode: 400, RequestID: xxxxx-xxxx-xxxxx-xxxxx, api error MissingParameter: The request must contain the parameter MessageGroupId."

And when I look at the documentation it seems like it should work if you provide the messageGrouplId in the template as follows

template.deployment-ready: |
  message: |
    Deployment {{.obj.metadata.name}} is ready!
  messageGroupId: {{.obj.metadata.name}}-deployment

but when I look at the code, from the structure of classes used for unmarshalling YAML, it seems like it is expecting the template to be something like this

template.deployment-ready: |
  message: |
    Deployment {{.obj.metadata.name}} is ready!
  awssqs:
    messageGroupId: {{.obj.metadata.name}}-deployment

Documentation being wrong is one problem, but even if I provide the messageGroupId and I see that it is parsed properly when I test it with argocd admin notifications template notify command.

But still when I try to trigger the notification I again get the error and the reason for this could be the code here. Because it seems the MessageGroupId is not added to the request at all in the function sendMessageInput.

I am not too fluent in Go otherwise I would have created the pull request. Would be nice if someone could review the code and make the necessary changes.

zahidzia avatar Oct 14 '24 13:10 zahidzia

I think I've hit the same issue. Were you able to solve in a different way/using a workaround or the solution is to use a standard queue?

themaroqa avatar Apr 16 '25 16:04 themaroqa