Service Bus Trigger vs Console App using Service Bus SDK

상준 이 251 Reputation points
2022-02-17T04:31:34.13+00:00

If there is one message in Service Bus, Azure Functions fetches and processes the message quickly, but if you subscribe to Service Bus in the console, you may have to wait a long time to process it. Why is this?

Since Service Bus SDK is a method of subscribing to events, I cannot get data at will, and I have to wait until the SDK triggers a Message Event.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
623 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,979 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,426 Reputation points
    2022-02-17T08:38:42.883+00:00

    @상준 이 Please correct if my understanding is right. "When you create the azure function service bus trigger and send one message then you observe that the message is consumed instantly but when you have tried to consume the message using your console application then you observe that there is a delay while retrieving the send message."

    Can you please share more details on which SDK you are using along with your service code?

    Azure service bus is the pull model and the message are available to the client to be consumed as soon it is sent to the service bus (only active messages and not schedule messages). It will depend upon the client how you are consuming the message from service bus, SDK, network in between, etc. I will suggest you to test with Azure.Messaging.ServiceBus in case you are using the .NET core application and you can refer to the sample here. The throughput may differ in case if standard service bus namespace according to the operation on your namespace.
    But in case if you are testing it with a few messages then it should have any effect.

    For testing purpose, I have used the sample code here and I can see that the message is received instantly to my consumer application. For sending the messages I have used the service bus explorer and my receiver is the console application. We are using the ServiceBusProcessor that reads and processes messages from the queue

    175290-sb.gif


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.