-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
If you have code such as:
await subscriber.Initialise(new[] {Assembly.GetExecutingAssembly()}))
await subscriber.ListenForMessages(tokenSource);
And the subscription can't be found, the subscriber will continue to run:
info: Pat.Subscriber.SubscriptionBuilder[0]
Building subscription 1 on service bus mailmachinegun-ns.servicebus.windows.net/...
crit: Pat.Subscriber.SubscriptionBuilder[0]
Unable to find servicebus topic 'patAbc123' subscriber will terminate.
info: Pat.Subscriber.AzureServiceBusMessageReceiverFactory[0]
Adding on subscription client 1 to list of source subscriptions
info: Pat.Subscriber.Subscriber[0]
Listening for messages...
warn: Pat.Subscriber.BatchProcessing.DefaultBatchProcessingBehaviour[0]
MessagingCommunicationException was thrown, subscriber will retry to get messages from service bus soon.
The current recommended is:
if (await subscriber.Initialise(new[] {Assembly.GetExecutingAssembly()}))
{
await subscriber.ListenForMessages(tokenSource);
}
I think that subscriber.Initialise should not return a bool and should throw the Exception if it cannot initialise.
At the moment there are some occasions where it returns false and some where an Exception will be thrown which is confusing, and also leads to ability to make mistakes.
Thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested