0
votes

I have a multi instance application, i'm using service bus event hubs to put into it some messages and it broadcast to all other instances, the condition to get the message to all instances is that every instance need to be in a separate consumers group otherwise an instance is going to get the message and delete it so other instance won't get the message, so my solution was that first every instance creates it's own consumers group and then listen to the event hub, but the problem here is that i will have a lot of consumers groups not in use after a while due to instances crashes, my question is : is it possible to detect and get all consumers groups that are not in use to delete theme ?

P.S : i tried with topic/subscription also, it works well, but i have the same problem just replace above consumer group by subscription :) .

1
When you application start, can you just check if the consumer group already exists ?Thomas
Hi @thomas , yes i can get all consumers group with all the properties like (createdAT, name ...). Using the code below : namespaceManager.GetConsumerGroups("<hubName>").ToList();Khalil Liraqui

1 Answers

0
votes

I got the answer : no you can't detect consumers groups witch are not in use but in the other hand you can detect that a subscription is not in use because it has a property "LastAccessDate" so using this field i can see if a subscription is in use or not and when was the last accessedDate, so i change from my service bus "event hub" to "topic/subscription" and it works :).