Illishar
Illishar

Reputation: 916

Retrieve Azure AccessedAt Value through REST

I'm trying to retrieve the "AccessedAt" value from the "QueueDescription" in Windows Azure Service Bus.

The code to retrieve it through the .NET libs look like this:

TokenProvider credentials = TokenProvider.CreateSharedSecretTokenProvider("owner", "[SECRET]");
NamespaceManager namespaceClient = new NamespaceManager(new Uri("https://[NAMESPACE].servicebus.windows.net/"), credentials);
QueueDescription q = namespaceClient.GetQueue("[QUEUE]");

Notice that the above is HTTP communication. It ought to be the same as REST. One can do the same with the simple REST interface. See this tutorial: http://msdn.microsoft.com/en-us/library/windowsazure/hh416754.aspx

But when you do it with REST you get this output:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
   <id>https://[NAMESPACE].windows.net/[QUEUE]</id>
   <title type="text">[QUEUE]</title>
   <published>2014-03-25T14:31:36Z</published>
   <updated>2014-03-25T14:31:36Z</updated>
   <author>
      <name>[NAMESPACE]</name>
   </author>
   <link rel="self" href="https://[NAMESPACE].servicebus.windows.net/[QUEUE]" />
   <content type="application/xml">
      <QueueDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
         <LockDuration>PT1M</LockDuration>
         <MaxSizeInMegabytes>1024</MaxSizeInMegabytes>
         <RequiresDuplicateDetection>false</RequiresDuplicateDetection>
         <RequiresSession>false</RequiresSession>
         <DefaultMessageTimeToLive>P10675199DT2H48M5.4775807S</DefaultMessageTimeToLive>
         <DeadLetteringOnMessageExpiration>false</DeadLetteringOnMessageExpiration>
         <DuplicateDetectionHistoryTimeWindow>PT10M</DuplicateDetectionHistoryTimeWindow>
         <MaxDeliveryCount>10</MaxDeliveryCount>
         <EnableBatchedOperations>true</EnableBatchedOperations>
         <SizeInBytes>0</SizeInBytes>
         <MessageCount>0</MessageCount>
      </QueueDescription>
   </content>
</entry>

No "AccessedAt" value. I cannot find the difference between the two methods. I'm using this on a non PC. Hence the need of the REST api. I've tried digging through the Microsoft.ServiceBus.dll to see if it's a header or something that's missing. And there are some more headers added but they don't seem to make a difference. Or perhaps I haven't found the right one. (The Microsoft.ServiceBus.dll is not very transparent.)

Anyone knows how to get the "AccessedAt" value through REST?

Upvotes: 0

Views: 85

Answers (1)

Abhishek Lal
Abhishek Lal

Reputation: 3231

The Service Bus REST API has a query parameter "api-version", can you try to pass in ?api-version="2014-01" and see if that fixes the issue?

Upvotes: 1

Related Questions