Manage subscription in SQL database table

Have 2 issue with subscription table

  1. While we deploy a new release it always put a new subscription entry to table with different version for event.Is this OK ? any way to avoid of this ?
  2. We have move few event handler from endpoint A to B, still in subscription table we have entry for endpoint A,
    2.a i am using Bus.Unsubscribe to unsubscribe but it unsubscribe for specific version of event only not all events, any other solution for this ?
    2.b truncate subscription table manually , do we have another approach ?

Store your message in a specific message assembly and keep the assembly version the same. Only update the file version. Message types are contracts, their versions should not change.

No, you have to unsubscribe for each specific event explicitly. However, we have a sample that shows how you can decommission subscribers in a slightly different way then the subscribe/unsubscribe API’s:

Instead of message driven pubsub it is also possible to use file based routing. If you move handlers to different endpoints a lot this might be an alternative. You have to keep your routing configuration in order manually, it will not be automatically setup anymore.

Also see the following useful links on how to deal with moving handlers and decommissioning endpoints.

– Ramon