dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

Unable to send SNS with MessageAttribute in InvokingBindingAsync()

Open SPrabaga opened this issue 3 years ago • 2 comments

We need to send sns notification with message attribute also on daprClient.InvokingBindingAsync(), to filter sns message based on message attribute filter policy subscription. could you please help.

SPrabaga avatar Sep 22 '22 07:09 SPrabaga

Could you please confirm message attribute added on daprClient.InvokingBindingAsync() method Request. Like this Request: request.MessageAttributes.Add( "SNSType", new MessageAttributeValue() { Type = "String", Value = "SNS" });

Response: For the Subscription filter policy. Like this on AWS { "SNSType": [ "Type ":"String" "Value":" SNS" ] }

Could you please update asap. Thanks

SPrabaga avatar Sep 23 '22 05:09 SPrabaga

The InvokeBinding call just takes your provided object/data (serialized to json if an object) and sends it to the component. So if you're encoding that into your request object, it should be fine.

If you're asking if the BindingRequest object has a MessageAttributes field. It does not. Bindings are generic and we don't have anything tech specific in the object.

halspang avatar Sep 23 '22 19:09 halspang

@SPrabaga - Do you need anything else here?

halspang avatar Oct 25 '22 00:10 halspang

I'm going to close this issue, feel free to reopen if you need more help.

halspang avatar Oct 28 '22 21:10 halspang