当前位置: 首页>>代码示例>>C#>>正文


C# NamespaceManager.GetQueue方法代码示例

本文整理汇总了C#中NamespaceManager.GetQueue方法的典型用法代码示例。如果您正苦于以下问题:C# NamespaceManager.GetQueue方法的具体用法?C# NamespaceManager.GetQueue怎么用?C# NamespaceManager.GetQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NamespaceManager的用法示例。


在下文中一共展示了NamespaceManager.GetQueue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SBMessageCounter

 public SBMessageCounter(string ns, string queue, string keyName, string key)
 {
     var sb = ServiceBusEnvironment.CreateServiceUri("sb", ns, String.Empty);
     TokenProvider tokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(keyName, key);
     NamespaceManager sbus = new NamespaceManager(sb, tokenProvider);
     var q = sbus.GetQueue(queue);
     MessageCount = q.MessageCount;
 }
开发者ID:mukaibot,项目名称:servicebus-monitoring,代码行数:8,代码来源:SBMessageCounter.cs

示例2: PurgeQueue

        public static void PurgeQueue(Uri baseAddress,string queueName,TokenProvider credentials)
        {
            Debug.Assert(QueueExists(baseAddress,queueName,credentials));

             NamespaceManager namespaceClient = new NamespaceManager(baseAddress,credentials);
             QueueDescription description = namespaceClient.GetQueue(queueName);

             DeleteQueue(baseAddress,queueName,credentials);

             CreateQueue(baseAddress,queueName,description,credentials);
        }
开发者ID:JMnITup,项目名称:SMEX,代码行数:11,代码来源:ServiceBusHelper+-+Queues.cs

示例3: Main

 static void Main(string[] args)
 {
     GetUserCredentials();
     TokenProvider credentials = null;
     Uri serviceUri = null;
     CreateTokenProviderAndServiceUri(out credentials, out serviceUri);
     MessagingFactory factory = null;
     try
     {
         NamespaceManager namespaceClient = new NamespaceManager(serviceUri, credentials);
         if (namespaceClient == null)
         {
             Console.WriteLine("\nUnexpected Error: NamespaceManager is NULL");
             return;
         }
         QueueDescription queueDescription = namespaceClient.GetQueue(Receiver.QueueName);
         if (queueDescription == null)
         {
             Console.WriteLine("\nUnexpected Error: QueueDescription is NULL");
             return;
         }
         QueueClient myQueueClient = CreateQueueClient(serviceUri, credentials, out factory);
         Console.WriteLine("\nReceiving messages from Queue '{0}'...", Receiver.QueueName);
         // Numero actual de mensagens na queue
         long messageCount = queueDescription.MessageCount;
         ReceiveNMessagesFromQueue(myQueueClient, messageCount);
         Console.WriteLine("\nEnd of scenario, press ENTER to exit.");
         Console.ReadLine();
     }
     catch (Exception e)
     {
         Console.WriteLine("Unexpected exception {0}", e.ToString());
         throw;
     }
     finally
     {
         if (factory != null) factory.Close();
     }
 }
开发者ID:cmfaustino,项目名称:PROMPT11-10-Cloud-Computing.cmfaustino,代码行数:39,代码来源:Receiver.cs

示例4: QueueExists

 static bool QueueExists(Uri baseAddress,string queueName,TokenProvider credentials,bool requiresSession = false)
 {
     try
      {
     NamespaceManager namespaceClient = new NamespaceManager(baseAddress,credentials);
     QueueDescription queue = namespaceClient.GetQueue(queueName);
     return true;
      }
      catch(MessagingEntityNotFoundException)
      {}
      return false;
 }
开发者ID:JMnITup,项目名称:SMEX,代码行数:12,代码来源:ServiceBusHelper+-+Queues.cs


注:本文中的NamespaceManager.GetQueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。