Ejemplo n.º 1
0
        public static bool TryCreate(string serviceId, string serviceSecret, string queueName, bool ensureQueue, out SqsQueue queue)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);
            SqsQueue[] queues = ListQueues(service).ToArray();

            foreach (SqsQueue q in queues)
            {
                if (q.Name.Equals(queueName, StringComparison.InvariantCultureIgnoreCase))
                {
                    queue = q;
                    return true;
                }
            }

            if (ensureQueue)
            {
                queue = Create(service, queueName);
                return true;
            }

            queue = null;
            return false;
        }
Ejemplo n.º 2
0
 public Receipt(SqsQueue queue, string message, string receiptHandler)
 {
     _queue         = queue;
     _message       = message;
     _receiptHandle = receiptHandler;
 }
Ejemplo n.º 3
0
 public Receipt(SqsQueue queue, string message, string receiptHandler)
 {
     _queue = queue;
     _message = message;
     _receiptHandle = receiptHandler;
 }
Ejemplo n.º 4
0
        public static bool TryCreate(string serviceId, string serviceSecret, string queueName, bool ensureQueue, out SqsQueue queue)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);

            SqsQueue[] queues = ListQueues(service).ToArray();

            foreach (SqsQueue q in queues)
            {
                if (q.Name.Equals(queueName, StringComparison.InvariantCultureIgnoreCase))
                {
                    queue = q;
                    return(true);
                }
            }

            if (ensureQueue)
            {
                queue = Create(service, queueName);
                return(true);
            }

            queue = null;
            return(false);
        }