abpframework / abpframework/abp
How to unsubscribe to an event when we remove an distributed event handler
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 3.7k
- Avg merge
- 15h 32m
- Merged PRs (30d)
- 106
Description
When we create a class implements the IDistributedEventHandler<T> (see), ABP automatically subscribes to the event. When you use the RabbitMQ provider, it subscribes to the event on the rubbitmq as durable.
That's fine and what we want. However, assume that we've decided to remove this handler. How to unsubscribe from the event? We need to discuss this.
Possible ideas (without thinking much):
- ABP gets a list of already subscribed events, checks with the current handlers, find the diff and removes old subscriptions. But this require some rabbitmq integration and I don't know if rabbitmq API allows it. Should check.
- Developer manually maintains a list of events to unsubscribe. ABP checks this list on app startup and unsubscribes from rabbitmq. This reduces startup time a little, but this is not important. Essential problem is: a) we need to manually manage it, b) when we decide to clean this list? When we sure that all unsubscribed? How to automate?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced IDistributedEventHandler interface and inspect how the RabbitMQ provider creates durable subscriptions. Compare the proposed automatic and manual unsubscribe approaches, then establish the lifecycle, cleanup behavior, and verification needed before implementation can be considered complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, rabbitmq
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100