Пример #1
0
        public void PutMessage(string content, int priority, int characterSet, string correlationId, string groupId, int?lsn)
        {
            var ep  = BuildExtendedProperties(correlationId, groupId, lsn);
            var msg = QueueSource.NewMessage(content, priority, characterSet, ep);

            QueueSource.PutMessages(new[] { msg }, CancellationToken.None);
        }
Пример #2
0
        public void PutMessages(IEnumerable <string> contents, int priority, int characterSet, string correlationId, string groupId, int?lsn, CancellationToken ct, IProgress <int> progress)
        {
            var msgs = contents.Select(s =>
            {
                var ep = BuildExtendedProperties(correlationId, groupId, lsn);
                if (lsn.HasValue)
                {
                    lsn++;
                }
                return(QueueSource.NewMessage(s, priority, characterSet, ep));
            }).ToList();

            QueueSource.PutMessages(msgs, ct, progress);
        }