Cancelling subscriptions does not consume the message
See original GitHub issue(Queue names fixed based on @micdenny comments)
Maybe I am doing something wrong.
My system works with prefetchcount=1
and I have multiple asynchronous subscriptions for different topics, for example:
var subscription1 = bus.SubscribeAsync(queueName1, OnMessage1, cfg => cfg.WithTopic("topic1"));
var subscription2 = bus.SubscribeAsync(queueName2, OnMessage2, cfg => cfg.WithTopic("topic2"));
var subscription3 = bus.SubscribeAsync(queueName3, OnMessage3, cfg => cfg.WithTopic("topic3"));
then while a message is being processing, I cancel a subscription, for example:
subscription1.ConsumerCancellation.Dispose();
The thread that was processing the subscription finished correctly, so the message has been processed, but if I start a new subscription for that topic, the message is processed again:
var anotherSubscription = bus.SubscribeAsync(queueName1, OnMessage1, cfg => cfg.WithTopic("topic1"));
Do you have an idea about how can I fix it to avoid process the same message twice?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
If you want to cancel a subscription from Apple
Open the Settings app. Tap your name. Tap Subscriptions. The Subscriptions button in Settings on iPhone. Tap the subscription. Tap Cancel ...
Read more >Cancel, pause, or change a subscription on Google Play
Important: When you uninstall the app, your subscription won't cancel. On your Android device, go to your subscriptions in Google Play. Select the...
Read more >Unable to cancel subscription
When I have tried to cancel my subscription (zoom one) I got the message "You should firstly cancel all additional subscriptions." Then I...
Read more >Cancel subscriptions
Subscriptions are canceled automatically after up to four unsuccessful attempts to bill the customer. You can configure this in your subscription lifecycle ...
Read more >Consumers
In this sense a consumer is a subscription for message delivery that has to be registered before deliveries begin and can be cancelled...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree! however in case of a ‘controlled’ cancellation it should be possible to have the option to finish/ACK the messages that have been picked up.
Thanks @micdenny!
Very detailed and useful answer, I will read the links and try to adapt my consumer to be idempotent.