Exemplo n.º 1
0
        private static async Task Queue_Send()
        {
            var config = GetConfig();

            var settings = new AzureQueueSettings(
                connectionString: config["ServiceBus_ConnectionString"],
                queueName: config["ServiceBus_QueueName"]);

            var message = new Message {
                Text = $"Hello Queue at {DateTime.Now.ToString()}"
            };

            IAzureQueueSender <Message> sender = new AzureQueueSender <Message>(settings);
            await sender.SendAsync(message);

            Console.WriteLine("Sent");
        }
Exemplo n.º 2
0
        private static async Task Queue_Send()
        {
            var config = GetConfig();

            //var connName = "Endpoint=sb://az532testbusmsm.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=H3/Z/4jxtfGqToxT14cOPRjk0bBGR+G7aFU8b7Ej1sE=";
            //var queueName = "az532testqueue";


            var settings = new AzureQueueSettings(
                connectionString: config["ServiceBus_ConnectionString"],
                queueName: config["ServiceBus_QueueName"]);

            var message = new Message {
                Text = $"Hello Queue at {DateTime.Now.ToString()}"
            };

            IAzureQueueSender <Message> sender = new AzureQueueSender <Message>(settings);
            await sender.SendAsync(message);

            Console.WriteLine("Queue_Send --> Sent message : " + message.Text);
        }