<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure Support &#187; Queue</title>
	<atom:link href="http://www.azuresupport.com/tag/queue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.azuresupport.com</link>
	<description>Windows Azure Tutorial</description>
	<lastBuildDate>Mon, 25 Apr 2011 10:32:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Queue Polling In Azure</title>
		<link>http://www.azuresupport.com/2010/02/queue-polling-in-azure/</link>
		<comments>http://www.azuresupport.com/2010/02/queue-polling-in-azure/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 12:47:39 +0000</pubDate>
		<dc:creator>azuresupport</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Azure Storage]]></category>
		<category><![CDATA[Queue]]></category>

		<guid isPermaLink="false">http://www.azuresupport.com/?p=608</guid>
		<description><![CDATA[In a previous tutorial we showed how to create and receive a message from queue , we can now adding polling The MessageQueue class in StorageClient contains the polling inbuilt  infrastructure and delivers the message via eventing: mqObj.MessageReceived += new MessageReceivedEventHandler(mqObj_MessageReceived); mqObj.PollInterval = 1000; // poll interval in milliseconds mqObj.StartReceiving(); // starts polling The event [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous tutorial we showed how to <a href="http://www.azuresupport.com/2010/02/creating-an-azure-queue-service/">create and receive a message from queue </a>, we can now adding polling</p>
<p>The <span style="font-family: Courier New;">MessageQueue</span> class in StorageClient contains the polling inbuilt  infrastructure and delivers the message via eventing:</p>
<p>mqObj.MessageReceived += new MessageReceivedEventHandler(mqObj_MessageReceived);<br />
mqObj.PollInterval = 1000; // poll interval in milliseconds<br />
mqObj.StartReceiving(); // starts polling</p>
<p><span style="font-size: medium;"><span style="font-size: medium;"> </span></p>
<p><span style="font-size: medium;"><span style="color: #000000; font-size: x-small;">The event handler fires whenever a message is received, in addition, when there are no more messages the client will begin polling the queue at the  <span style="font-family: Courier New;">PollInterval</span></span></span></p>
<p><span style="font-size: medium;"><span style="color: #000000; font-size: x-small;">In this code sample no timeout is set and so the default is selected from the <span style="font-family: Courier New;">Timeout</span> property of the <span style="font-family: Courier New;">MessageQueue</span> class (which in turn defaults to 30 seconds).</span></span></p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.azuresupport.com/2010/02/queue-polling-in-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an Azure Queue Service</title>
		<link>http://www.azuresupport.com/2010/02/creating-an-azure-queue-service/</link>
		<comments>http://www.azuresupport.com/2010/02/creating-an-azure-queue-service/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 09:35:00 +0000</pubDate>
		<dc:creator>azuresupport</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Azure Storage]]></category>
		<category><![CDATA[Queue]]></category>

		<guid isPermaLink="false">http://www.azuresupport.com/?p=601</guid>
		<description><![CDATA[This simple tutorial demonstrates how to create a message on a queue and receive that message: 1. Set up Authentication Details and Create a New Queue The below code adds the the storage authentication details, creates a queue storage object (which is the storage container that the Message Queues are placed in), then creates a [...]]]></description>
			<content:encoded><![CDATA[<p>This simple tutorial demonstrates how to create a message on a queue and receive that message:</p>
<h3>1. Set up Authentication Details and Create a New Queue</h3>
<p>The below code adds the the storage authentication details, creates a queue storage object (which is the storage container that the Message Queues are placed in), then creates a message queue and finally adds a message to that queue:</p>
<p>string accName = &#8220;devacc1&#8243;;</p>
<p>string accKey = &#8220;accountKeyStringxxxx&#8221;;</p>
<p>string address = &#8220;http://127.0.0.1:10001&#8243;;</p>
<p>StorageAccountInfo acObj = new StorageAccountInfo(new Uri(address), null, accName, accKey);</p>
<p>QueueStorage qsObj = QueueStorage.Create(acObj);</p>
<p>MessageQueue mqObj = qsObj.GetQueue(&#8220;azureSupportString&#8221;);</p>
<p>mq.CreateQueue();</p>
<p>Message msgObj = new Message(DateTime.Now.ToString());</p>
<p>mqObj.PutMessage(msgObj);</p>
<h3>2. Receiving a Message from the Queue</h3>
<p>The code for receiving a message from a queue is very straightforward. Use the GetMessage method of the MessageQueue with the time out in seconds passed in as a parameter. This timeout is the time that routine has a lock on the message, if it is not deleted within the timeout time other processes will be able to access it. <br />
 The GetMessage method returns null if there is no message on the queue so your code needs to check for that. Also note that the message remains on the queue if it is not deleted so call the DeleteMessage method to delete the message.</p>
<p>Message msgObj = mqObj.GetMessage(3);<br />
 if (msgObj != null)<br />
 {<br />
 Console.WriteLine(msgObj.ContentAsString());<br />
 mqObj.DeleteMessage(msgObj);<br />
 }</p>
<p>We can also add <a href="http://www.azuresupport.com/2010/02/queue-polling-in-azure/">Queue Polling </a>to this routine</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azuresupport.com/2010/02/creating-an-azure-queue-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

