private static void RunMulticastErrorHandlingCase4() { EmptyQueues(); System.Console.Write("In the final example, we also delete the backup logging queue. Now the Routing Service will be unable to transactionally deliver the "); System.Console.Write("message to both a service queue and a backup queue, so it shouldn't move the message at all. At the end of this, we should see that "); System.Console.Write("because the Routing Service was unable to transactionally deliver the message to both a service queue and a logging queue, MSMQ marks "); System.Console.WriteLine("the message undeliverable. Based on our MSMQ settings, this should place it in the system Transactional DLQ. "); System.Console.WriteLine("Deleting the backup logging queue"); QueueUtils.DeleteQueue(backupLoggingPath); QueueUtils.InsertMessageIntoQueue("net.msmq://localhost/private/inQ"); System.Console.WriteLine("Press <Enter> to begin routing messages"); System.Console.ReadLine(); PrintQueueStatus(); }
private static void RunMulticastErrorHandlingCase1() { EmptyQueues(); QueueUtils.InsertMessageIntoQueue("net.msmq://localhost/private/inQ"); System.Console.Write("In this case, we should see one message show up in the primary service queue and one message show up in the primary logging queue."); System.Console.Write(" This is because the Routing Service is receiving one message from the inbound queue and multicasting it to the two endpoint"); System.Console.Write(" lists we configured before. Since the primary endpoints are responding, both of them accept the message and the Routing Service "); System.Console.Write("is able to complete the transaction, successfully moving the message from the inbound queue to the primary service queue and the "); System.Console.WriteLine("primary logging queue."); System.Console.WriteLine("Press <Enter> to begin routing messages"); System.Console.ReadLine(); PrintQueueStatus(); System.Console.WriteLine("Press <Enter> to continue"); System.Console.ReadLine(); }
private static void RunMulticastErrorHandlingCase3() { EmptyQueues(); System.Console.Write("In this example, we also delete the primary logging queue, forcing the Routing Service to send the message to both the backup "); System.Console.Write("service queue and the backup logging queue. Since both primary queues are unavailable, but the backup queues are present, we should "); System.Console.Write("see that the Routing Service is able to complete the transaction, successfully moving the message from the inbound queue to both the "); System.Console.WriteLine("backup service queue and the backup logging queue."); System.Console.WriteLine("Deleting the primary logging queue"); QueueUtils.DeleteQueue(primaryLoggingPath); QueueUtils.InsertMessageIntoQueue("net.msmq://localhost/private/inQ"); System.Console.WriteLine("Press <Enter> to begin routing messages"); System.Console.ReadLine(); PrintQueueStatus(); System.Console.WriteLine("Press <Enter> to continue"); System.Console.ReadLine(); }
private static void RunMulticastErrorHandlingCase2() { EmptyQueues(); System.Console.Write("In this example, we are going to delete the primary service queue, simulating a situation in which the system is unavailable "); System.Console.Write("for some reason. In this case, we should see one message show up in the backup service queue, and one message show up in the "); System.Console.Write("primary logging queue. This is beacuse the Routing Service is failing to contact the primary service queue (it doesn't exist), "); System.Console.Write("and so automatically fails that transaction and creates another to wrap the sends that occur to the backup service queue and the "); System.Console.Write("primary logging queue. Since the backup service queue and the primary logging queue both respond, the Routing Service is able "); System.Console.Write("to complete the transaction, successfully moving the message from the inbound queue to the backup service queue and the primary "); System.Console.WriteLine("logging queue"); System.Console.WriteLine("Deleting the primary service queue"); QueueUtils.DeleteQueue(primaryServicePath); QueueUtils.InsertMessageIntoQueue("net.msmq://localhost/private/inQ"); System.Console.WriteLine("Press <Enter> to begin routing messages"); System.Console.ReadLine(); PrintQueueStatus(); System.Console.WriteLine("Press <Enter> to continue"); System.Console.ReadLine(); }