Mock Azure Service Bus locally

Viewed 2129

I want to mock Azure Service Bus locally for test.

The origin code looks like:

var client = new QueueClient("Endpoint=sb://host/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey="xxx",
                "myqueue");
await client.SendAsync(message);

and messages will be received in AzureFunction with a ServiceBusTrigger.

I believe it is possible to change Endpoint to localhost and then establish a server listening on localhost to receive and forward messages. But how could I do it?

First of all, does the Microsoft.Azure.ServiceBus SDK send message in AMQP protocal? So, I have to establish a service handling AMQP messages?

After searching docs, it seems Service Bus also supports REST ways to send message. Could we do that in Microsoft.Azure.ServiceBus SDK, so that I can easily build a http server to handle messages.

Really need some idea for this task.

0 Answers
Related