1

All messages in a subscription to an Azure Service Bus topic are sent to the dead letter queue with a FilterException saying

Operator '==' cannot be applied to operands of type 'string' and 'System.DBNull'

The filter is of type SqlFilter and the expression is:

TriggerEvent in ("A01", "A04", "A28", "A47") OR (TriggerEvent = "A31" AND EventReasonCode = "REG_MANUAL")

This has been running for months without any FilterException, and it currently runs fine in a different environment for production.

A collegue found the reason for this error, and since I didn't find anything relevant when googling this error, I'll post this question and the answer to it right away.

Eivind Gussiås Løkseth
  • 1,862
  • 2
  • 21
  • 35

1 Answers1

0

For some reason the test environment has been updated with double quotes instead of single quotes around the trigger events and reason code stings like this:

TriggerEvent = "A31" AND EventReasonCode = "REG_MANUAL"

When we changed that back to single quotes, everything was fine:

TriggerEvent in ('A01', 'A04', 'A28', 'A47') OR (TriggerEvent = 'A31' AND EventReasonCode = 'REG_MANUAL')

The error message is misleading and it's hard to see what the reason might be, because I couldn't find any System.DBNull value anyhere.

Eivind Gussiås Løkseth
  • 1,862
  • 2
  • 21
  • 35