0

There is an example here that explains on how to send messages and receive messages using Azure Service Bus through a publisher and subscriber application.

My questions are about the subscriber application that receives messages:

  1. Does registering in the application a message handler with subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions); process the messages 24/7 until the application is shut down?
  2. Can I deploy the subscriber console app in Azure only through Docker Container? If I don't want to use containers, what is the other hosting option I have? I have done CI/CD pipeline to host a WebAPI in Azure App Services from Visual Studio 2019 before.
wonderful world
  • 10,969
  • 20
  • 97
  • 194

1 Answers1

1

Does registering in the application a message handler with subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions); process the messages 24/7 until the application is shut down?

That's correct. That API is intended for the continuous flow of messages that needs to be processed.

Can I deploy the subscriber console app in Azure only through Docker Container? If I don't want to use containers, what is the other hosting option I have?

You can host continuously running Azure Service Bus processing using the following options:

  • Virtual Machine(s)
  • AKS/ACI
  • Service Fabric
  • Azure WebJobs (requires a WebApp)

An alternative option would be to look into Azure Functions. While it doesn't run 24/7, it allows a reactive type of application.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • My message handler has to process huge amount of data, so I'm trying to keep away from the Azure Functions which I believe has to be quick to run. I have got training from Udi Dahan last year. As my product matures, I may move to **NServiceBus**. – wonderful world Jun 14 '20 at 00:57
  • 1
    Azure Functions has execution time constrain of 10 minutes per execution on the Consumption plan, 60 minutes under Premium, and unlimited under Dedicated (App Service). If you have that much data to process per message that requires a long execution, you can use any other hosting option that allows 24/7 running or look into Functions on Premium or dedicated. More info [here](https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale). – Sean Feldman Jun 16 '20 at 04:23