This article explains about various filters that can be used on the service bus topic: https://docs.microsoft.com/en-us/azure/service-bus-messaging/topic-filters
I am interested in using the "user-defined properties" discussed on that page. How do we set those properties when using ServiceBusMessage class to set the message and then send it using ServiceBusSender class?
CodePudding user response:
Thank you Andrew Williamson for your suggestion ,converting this as to answer to help other community members.
"Add your custom properties to ServiceBusMessage.ApplicationProperties
before you send the message from your publisher, and read them when you receive the message in your consumer".
Also as mentioned in GitHub .
In v7, the
userProperties
and label on the message were renamed toapplicationProperties
and subject to be in sync with the AMQP spec. We did this across languages as part of our new SDKs.We realize that we should have done a better job at communicating this in our migration guide which is linked from the readme for the package in npm and github as well as from our changelog. We will do so immediately.
For more information please refer this SO THREAD : How do I add a custom property using the Azure.Messaging.ServiceBus library