This repository is sample implementation of Asynchronous Request-Reply pattern in Azure Service Bus.
az group create --name RequestReplyPattern --location 'west europe'
az servicebus namespace create --name requestreplyasb --resource-group RequestReplyPattern --sku Standard
az servicebus queue create --name request-queue --namespace-name requestreplyasb --resource-group RequestReplyPattern
az servicebus queue create --name reply-queue --namespace-name requestreplyasb --resource-group RequestReplyPattern --enable-session true
In both Producer
and Consumer
projects in Properties/launchSettings.json
paste connection string to your Azure Service Bus and run both applications. The first one contains API endpoints. You can send simple message with HTTP POST
to /send
, eg. /send?message=Hello world
.
In the response you should get session id, which using HTTP GET
request you can use to:
- Check session state =>
/getstate?messageid=<session-id>
- receive reply =>
/getresponse?messageid=<session-id>