Move messages in Service Bus Queue

If you want to know how to move the messages between two azure service bus queue for situations like production deployment or during a system outage or move the messages to a different service bus queue to manage the huge load etc, then you are landed up on a correct place. Before I show you how to do it, let me give a quick introduction of azure service bus queue.
Service bus queue offers simple first in, first out guaranteed message delivery, highly available with support for enterprise level messaging. Microsoft also offers Azure REST queue as a messaging service for distributed environment and the difference are outlined here. The message that comes in and goes out from service bus queue is called brokered message and it stores inside the service bus queue in a serialized format. The format could be JSON, binary, xml etc. which can be set during the send operation to the service bus queue. This tool retains the serialized message and move the same message to a different queue or a deadletter queue. Following code snippet is a simple console application which does the message movement between source and destination queue.

static void Main(string[] args) {
 try {
  string sbconnectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"];
  ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;

  var namespaceManager = NamespaceManager.CreateFromConnectionString(sbconnectionString);
  var src_queueName = "source_queue";
  var dest_queueName = "destination_queue";
  //var dest_queueName = "destination_queue/$deadletterqueue";

  QueueClient src_queue = MessagingFactory.CreateFromConnectionString(sbconnectionString).CreateQueueClient(src_queueName, ReceiveMode.ReceiveAndDelete);
  QueueClient dest_queue = MessagingFactory.CreateFromConnectionString(sbconnectionString).CreateQueueClient(dest_queueName, ReceiveMode.ReceiveAndDelete);

  while (true) {
   var message = src_queue.Receive(TimeSpan.FromSeconds(5));

   if (message != null) {
    //var clonemsg = message.Clone();
    Console.WriteLine("Message Read successfully!");
   } else {
    Console.WriteLine("Polling, polling, polling...");
 } catch (Exception ex) {

Before running the code, make sure to add the package from nuget repository. If you are accessing the message before sending it, you have to create a clone of the message because brokered message cannot be used in case the body of the message is already accessed (code is commented). Deadletter queue can be used as a destination queue and can be referred as {queue_name}/$deadletterqueue