First declare an instance of QueueingBasicConsumer () that completes the model.
From model execute model.BasicConsume (QueueName, false, consumer)
Then we implement a loop that will bypass messages from the queue, which then processes the next line - the consumer.Queue.Dequeue () method - waiting for the message to be received from the queue.
Then convert the byte array to a string and show it.
Model.BasicAck () - send a message from the queue to receive the next message
And then on the server side you can start to wait for the following message:
public string GetMessagesByQueue(string QueueName) { var consumer = new QueueingBasicConsumer(_model); _model.BasicConsume(QueueName, false, consumer); string message = string.Empty; while (Enabled) {
source share