Ejemplo n.º 1
0
 /// <summary>
 /// Reads an Order object from the "initialorder" queue
 /// Creates a blob for the specified order which contains the order details
 /// The message in "orders" will be picked up by "QueueToBlob"
 /// </summary>
 public static void MultipleOutput(
     [QueueTrigger("initialorder")] InovaQueue order,
     [Blob("orders/{OrderId}")] out string orderBlob,
     [Queue("orders")] out string orders)
 {
     orderBlob = order.OrderId;
     orders    = order.OrderId;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Shows binding parameters to properties of queue messages
 ///
 /// The "Name" parameter will get the value of the "Name" property in the Order object
 /// The "DequeueCount" parameter has a special name and its value is retrieved from the actual CloudQueueMessage object
 /// </summary>
 public static void PropertyBinding(
     [QueueTrigger("initialorder")] InovaQueue initialorder,
     string Name,
     int dequeueCount,
     TextWriter log)
 {
     log.WriteLine("New order from: {0}", Name);
     log.WriteLine("Message dequeued {0} times", dequeueCount);
 }
Ejemplo n.º 3
0
        private static void CreateDemoData()
        {
            string connectionString            = "DefaultEndpointsProtocol=https;AccountName=inovafiles;AccountKey=DIAf5tmIX05NzqK8kFEjbr1eU18Fk1AmzTmvolCu5iUnhdT73amRelFeNjUH+yp4z4Y60G1YA8B8wV6gHbl2bg=="; // AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.Storage);
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);

            CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
            CloudQueue       queue       = queueClient.GetQueueReference("workerroletest");

            queue.CreateIfNotExists();

            InovaQueue person = new InovaQueue()
            {
                Name    = "sujith",
                OrderId = Guid.NewGuid().ToString("N").ToLower()
            };

            queue.AddMessage(new CloudQueueMessage(JsonConvert.SerializeObject(person)));
        }