src/Messaging.cs
/// <summary>
/// Gets the next informed queue's message.
/// Once the message is dequeued, it is deleted from the queue.
/// Depending on the service, this method may take a few seconds to return, waiting for new messages before completion.
/// If no message is found, returns null.
/// </summary>
/// <param name="config">The queue configuration.</param>
/// <exception cref="InvalidOperationException">Occurs when the connection to the server fails.</exception>
Gets the next informed queue's message.
Once the message is dequeued, it is deleted from the queue.
Depending on the service, this method may take a few seconds to return, waiting for new messages before completion.
If no message is found, returns null.
Gets the next informed queue ' s message . Once the message is dequeued it is deleted from the queue . Depending on the service this method may take a few seconds to return waiting for new messages before completion . If no message is found returns null .
public static string Dequeue(string queueName, IMessagingConfig config)
        {
            queueName = queueName.ToLower();
            Utils.ValidateQueueName(queueName, true);
            string message = null;
            using (var client = new Messaging(config))
            {
                var transporter = client.GetTransporter(queueName);
                transporter.DequeueSingleMessage(queueName, (msg) =>
                {
                    message = msg;
                    return true;
                });
            }
            return message;
        }
public static string Dequeue ( string queueName , IMessagingConfig config ) { queueName = queueName . ToLower ( ) ; Utils . ValidateQueueName ( queueName , true ) ; string message = null ; using ( var client = new Messaging ( config ) ) { var transporter = client . GetTransporter ( queueName ) ; transporter . DequeueSingleMessage ( queueName , ( msg ) => { message = msg ; return true ; } ) ; } return message ; }
Gets the next informed queue's message.
Gets the next informed queue ' s message .
Occurs when the connection to the server fails.
Occurs when the connection to the server fails .
queueName
string
config
IMessagingConfig
The queue configuration.
The queue configuration .