user28306650
user28306650

Reputation: 1

Argo SQS event source and workflow dependencies for multiple payloads values on single SQS

I am working on configuring argo event sources and sensors to listen to AWS sqs messages. I need to trigger my workflow when all the dependencies are satisfied. These dependencies are various messages on the same SQS queue. For example: Trigger my workflow when I receive message with body value '{"event": "abc"}' and '{"event": "def"}'. Both the messages are expected to be on single sqs.

I tried couple of ways but none of them works.

  1. By configuring two filters on event source like below. I observed the first filter is processing the message even though the filter doesn't match. It simply prints filter didn't match and skips processing. Message that has payload '{"event": "def"}' isn't getting to 'example-sqs-def' event in below.
spec:   
  template:     
    serviceAccountName: argo-sa   
  sqs:     
    example-sqs-abc:       
      region: us-east-1       
      queue: my-queue       
      waitTimeSeconds: 0       
      jsonBody: true       
      filter:         
        expression: body.event == 'abc' 
    example-sqs-def:       
      region: us-east-1       
      queue: my-queue       
      waitTimeSeconds: 0       
      jsonBody: true       
      filter:         
        expression: body.event == 'def' 
  1. By configuring filters on Sensor like below. I give me below error.

Error : "event 'event-abc' from EventSource 'aws-sqs' is referenced for more than one dependency in this Sensor object"

spec:
  template:
    serviceAccountName: argo-sa
  dependencies:
    - name: abc
      eventSourceName: aws-sqs
      eventName: event-abc
      filters:
        expr: "event.body.event === 'abc' 
    - name: abc
      eventSourceName: aws-sqs
      eventName: event-abc
      filters:
        expr: "event.body.event === 'def' 

Upvotes: 0

Views: 57

Answers (0)

Related Questions