An implementation of a combination of SQL Server and MSMQ to handle two messaging via random acccess to messages so they can be retrived for long running tasks where both client and server can interact with each message for processing. This implementation uses SQL server for the actual data storage and MSMQ to handle the message de-queuing by storing IDs in MSMQ. MSMQ allows much greater throughput for dequeuing message ids when polled frequently. Great for long running tasks or even light workflow scenarios.
Inheritance: QueueMessageManagerSql, IDisposable
        public void AddManyQueueSqlMsMqItems()
        {
            var qm = new QueueMessageManagerSqlMsMq(connectionString);
            qm.MsMqQueuePath = @".\Private$\";

            for (int i = 0; i < 10; i++)
            {
                var item2 = new QueueMessageItem()
                {
                    Message = "MSMQ New Entry",
                    TextInput = "Process This",
                    QueueName = "MPWF",
                    Action = "HELLOWORLD",
                    Xml = string.Format(@"<doc>
    <company>East Wind</company>
    <name>Rick</name> 
    <time>{0}</time>
</doc>
", DateTime.Now.ToString("MMM dd - HH:mm:ss"))
                };
                Thread.Sleep(300);

                Assert.IsTrue(qm.SubmitRequest(item2, null, true), qm.ErrorMessage);
            }

            for (int i = 0; i < 10; i++)
            {
                var item2 = new QueueMessageItem()
                {
                    Message = "MSMQ New Entry",
                    TextInput = "Process This",
                    QueueName = "MPWF_VFP",
                    Action = "HELLOWORLD",
                    Xml = string.Format(@"<doc>
    <company>East Wind</company>
    <name>Rick</name> 
    <time>{0}</time>
</doc>
", DateTime.Now.ToString("MMM dd - HH:mm:ss"))
                };
                Thread.Sleep(300);

                Assert.IsTrue(qm.SubmitRequest(item2, null, true), qm.ErrorMessage);
            }
        }
 public void GetNextQueueMessage()
 {
     var qm = new QueueMessageManagerSqlMsMq(connectionString);
       
     var item = qm.GetNextQueueMessage("MPWF");
     Console.WriteLine(qm.ErrorMessage);
     Console.WriteLine(JsonSerializationUtils.Serialize(item, true));
 }