Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Adding a message in an Azure Queue

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 265
    Comment on it

    Azure queues are helpful in background processes. It provides reliable messaging solutions for independent asynchronous communication between components in application.

    Here is a sample code for adding message in a queue
     

    //Create an object of cloud storage                                                                                               
    CloudStorageAccount storageAccount= CloudStorageAccount.Parse(StorageConnectionString); 
    //Create an object of CloudQueueClient                                                                                  
    CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();              
    //Get reference of cloud queue by passing cloud queue name                                                        
     CloudQueue queue = queueClient.GetQueueReference("queueName");			       
    //Create a cloud key if it does not exists					  
    queue.CreateIfNotExists(); 								       
    //Create an CloudMessageQueue with our content  as constructor`s parameter           
    CloudQueueMessage message = new CloudQueueMessage(MyMessage); 		                   
    //Add Message to queue						              
    queue.AddMessage(message);
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: