简体   繁体   中英

Keeping filtered messages in azure service bus topic subscriptions

I have a topic with a single subscription in it. The subscription has a filter that filters a set of UserProperties. Filtering works fine.

The problem is, if a message is checked against the filters of the subscription and it fails to match the rules the message gets deleted. Is there a way to keep the messages in the subscription and not have them removed?

The reason I want this is we have our services configure the rules for subscription when deployed, and a service with a message broker that is sending a new set of messages might get deployed before the service with the subscription client changing the rule set and new business logic. We do not want to lose the messages sent during deployment and process them when the new service is out.

Cheers.

As the others have mentioned, this is by design and for your requirement, you have these options

  • Create subscriptions before hand which will persist the filtered messages and your subscriber service could fetch them from the subscription when it comes up.

  • Use Message Sessions on a queue instead with one session per subscriber. The requirement here though would be to have your initial deployment send messages with a unique SessionId set on these messages (which should essentially be based on the filters you have later now) instead of using filters later

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM