Sns topic subscription filter on a complex json

0

I have a json like below which gets published to my sns topic whenever a customer is inactivated by our api. The api also publishes messages to the same topic when other tables/columns are updated/inserted.

{
  "transaction": {
    "operation": "UPDATE",
    "tableName": "Customer",
    "primaryKeyColumn": "CustomerID"
  },
  "columns": [
    {
      "columnName": "FirstName",
      "hasChanged": false
    },
    {
      "columnName": "IsActive",
      "oldValue": "1",
      "newValue": "0",
      "hasChanged": true
    }
  ]
}

I would like to create a subscription filter which would filter if the customer is getting inactivated. For e.g., like below:

{
     "operation": ["UPDATE"],
     "tableName": ["Customer"],
     "columnName": ["IsActive"],
     "hasChanged": [true],
     "newValue": ["0"]
   }

The above subscription filter doesn't work. For e.g., if I add the filter, I don't get any message to my queue. But if I remove it, I get the message published to the queue. Any helps are appreciated.

amazon-sns amazon-web-services
2021-11-23 21:41:34
1

1

Looks like I found my answer here. I realize that I cannot filter on the message body. I will have to rewrite the filter policy with the attributes..

2021-11-23 22:12:37

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................