Пример #1
0
        static void EnqueueMessage(QueueItem item)
        {
            //mailhost
            MailHost host = null;

            if (!MailHosts.TryGetValue(item.Label, out host))
            {
                throw new MessageException(AcknowledgeStatus.InvalidMailHost, "Mail host not exists");
            }
            if (item.Segments > 0 && (int)item.Priority > (int)Priority.Normal)
            {
                RemoteQueueServer.QueueManager[host.ChunkQueueName].Enqueue(item);

                return;
            }
            int batchId = item.Segments > 0 ? item.OperationId : item.MessageId;

            string path = host.GetBatchPath(batchId);

            MailHost.CreateDirectory(path);
            item.Save(path);
        }