Example #1
0
        private void InitQueues()
        {
            _queueReader.RegisterPreHandler(data =>
            {
                if (data == null)
                {
                    Console.WriteLine("Queue had unknown SMS send request");
                    return(Task.FromResult(false));
                }
                return(Task.FromResult(true));
            });

            _queueReader.RegisterHandler <SendSmsData <SmsConfirmationData> >(
                "SmsConfirmMessage", HandleSmsRequestAsync);
            _queueReader.RegisterHandler <SendSmsData <string> >("SimpleSmsMessage", HandleSimpleSmsRequestAsync);

            Console.WriteLine($"Registered:{_queueReader.GetComponentName()}");
        }