Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (13.1k points)
I have an Azure service bus topic subscription where messages got pump up, but it only receive only one message at a time. So, is it possible to get around 10 messages at a time? Can anyone help me with this?

1 Answer

0 votes
by (26.7k points)

If you want to receive more messages then you should go for the concept of Prefetching. It will help you to load messages from the service. You try the below code as an example:

SubscriptionClient client = SubscriptionClient.CreateFromConnectionString(connectionString, topic, subName);

client.PrefetchCount = 10;

IEnumerable<BrokeredMessage> messageList = client.ReceiveBatch(5);

Also join azure developer training now!!

Want to become an Azure Developer? Watch this video on How to Become Azure Developer? | Learn Azure :

Related questions

0 votes
1 answer
0 votes
1 answer
asked Apr 15, 2020 in Azure by Sudhir_1997 (55.6k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...