I want to pull the messages from Azure service bus queue. I can pull it from the sample code provided here. The messages which are coming are coming line by line. In my case I need the entire message at once. How to do it?
2 Answers
@AnandDeshmukh, there are two way to pull messages from Azure Service Bus Queue, which include AMQP with JMS, REST API via HTTP.
I see you are using Azure Service Bus SDK for Java when you are refering to the tutorial to pull messages. According to the source codes of the SDK for Java on GitHub, you can discover that the SDK just wrapped the related REST APIs which only get a message via HTTP protocol at a time.
Although I don't know what your application scene is, if you want high performance for receiving messages, I recommend the better way is using AMQP for getting messages from queue. AMQP is a binary, application layer protocol, designed to efficiently support a wide variety of messaging applications and communication patterns, please see https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol to know it.

- 23,476
- 4
- 25
- 43
You can not get all messages at once but you can always make their batch(session) to deliver at once. For enabling session in service bus you need to do two changes.
1. While creating service bus chose to Enable Session
2. While pushing messaging to Service Bus set property SessionId of Message to same id for a batch

- 96
- 7