private static void SendUsingMessageTxScope(MessageQueueTemplate q)
        {
            IPlatformTransactionManager txManager           = new TxScopeTransactionManager();
            TransactionTemplate         transactionTemplate = new TransactionTemplate(txManager);

            transactionTemplate.Execute(status =>
            {
                q.ConvertAndSend("Hello World 1");
                q.ConvertAndSend("Hello World 2");
                q.ConvertAndSend("Hello World 3");
                return(null);
            });
        }
        public void SendAndReceiveNonTransactionalRemotePrivateQueue()
        {
            MessageQueueTemplate q = applicationContext["queueTemplate-remote"] as MessageQueueTemplate;

            Assert.IsNotNull(q);
            q.ConvertAndSend("Hello World 1");
            //ReceiveHelloWorld(null, q, 1);
        }
        private static void SendUsingMessageTx(string messageQueueObjectName, MessageQueueTemplate q)
        {
            IPlatformTransactionManager txManager           = new MessageQueueTransactionManager();
            TransactionTemplate         transactionTemplate = new TransactionTemplate(txManager);

            transactionTemplate.Execute(status =>
            {
                if (messageQueueObjectName == null)
                {
                    q.ConvertAndSend("Hello World 1");
                    q.ConvertAndSend("Hello World 2");
                    q.ConvertAndSend("Hello World 3");
                }
                else
                {
                    q.ConvertAndSend(messageQueueObjectName, "Hello World 1");
                    q.ConvertAndSend(messageQueueObjectName, "Hello World 2");
                    q.ConvertAndSend(messageQueueObjectName, "Hello World 3");
                }
                return(null);
            });
        }
 private static void SendUsingMessageTxScope(MessageQueueTemplate q)
 {
     IPlatformTransactionManager txManager = new TxScopeTransactionManager();
     TransactionTemplate transactionTemplate = new TransactionTemplate(txManager);
     transactionTemplate.Execute(status =>
                                     {
                                         q.ConvertAndSend("Hello World 1");
                                         q.ConvertAndSend("Hello World 2");
                                         q.ConvertAndSend("Hello World 3");
                                         return null;
                                     });
 }
 private static void SendUsingMessageTx(string messageQueueObjectName, MessageQueueTemplate q)
 {
     IPlatformTransactionManager txManager = new MessageQueueTransactionManager();
     TransactionTemplate transactionTemplate = new TransactionTemplate(txManager);
     transactionTemplate.Execute(status =>
                                     {
                                         if (messageQueueObjectName == null)
                                         {
                                             q.ConvertAndSend("Hello World 1");
                                             q.ConvertAndSend("Hello World 2");
                                             q.ConvertAndSend("Hello World 3");
                                         } else
                                         {
                                             q.ConvertAndSend(messageQueueObjectName, "Hello World 1");
                                             q.ConvertAndSend(messageQueueObjectName, "Hello World 2");
                                             q.ConvertAndSend(messageQueueObjectName, "Hello World 3");
                                         }
                                         return null;
                                     });
 }