I would like to consume Azure Service Bus Queue message from .NET core REST api.
I can do it locally on my laptop as I can manually run the API to consume the message.
After deploying this rest api as web app on Azure App Services..... How my WEB App will know, the message in "Azure service bus queue" is arrived and need to consume the same.
Note:
- I know this can be done using Azure Function - Service Bus Trigger
- I m more interested in Microservices - Producer - Consumer point of view
- Queue system could be Azure Service bus / RabbitMQ / Kafka etc
Tried to find on web, not got anything good.
You can implement the Peek message Function to just read the message without removing it from the service bus queue in your .net core API:-
Peek message queue sample:-
Program.cs:-
Given my Order.cs:-
You can also make use of Azure Functions directly and it will be triggered as soon as your service bus queue receives new message:-
Function1.cs:-