public static CreateFromConnectionString ( string connectionString ) : |
||
connectionString | string | Connection string |
리턴 |
/// <summary> /// Create an event hub client from a connection string /// </summary> /// <param name="connectionString">Connection string</param> /// <returns>Instace of EventHubSender class</returns> public static EventHubSender CreateFromConnectionString(string connectionString) { MessagingFactory factory = MessagingFactory.CreateFromConnectionString(connectionString); ServiceBusConnectionStringBuilder builder = new ServiceBusConnectionStringBuilder(connectionString); return(new EventHubSender(factory, Fx.Format("{0}/Publishers/{1}", builder.EntityPath, builder.Publisher), null)); }
/// <summary> /// Create a subscription client from a connection string /// </summary> /// <param name="connectionString">Connection string</param> /// <param name="topicPath">Path to the topic related entity</param> /// <param name="name">Name of the subscription</param> /// <param name="receiveMode">Receive mode</param> /// <returns>Instance of TopicClient class</returns> public static SubscriptionClient CreateFromConnectionString(string connectionString, string topicPath, string name, ReceiveMode receiveMode) { MessagingFactory factory = MessagingFactory.CreateFromConnectionString(connectionString); SubscriptionClient client = factory.CreateSubscriptionClient(topicPath, name, receiveMode); client.MessagingFactory = factory; return(client); }
/// <summary> /// Create a topic client from a connection string /// </summary> /// <param name="connectionString">Connection string</param> /// <param name="path">Path to the queue entity</param> /// <returns>Instace of TopicClient class</returns> public static TopicClient CreateFromConnectionString(string connectionString, string path) { MessagingFactory factory = MessagingFactory.CreateFromConnectionString(connectionString); TopicClient client = factory.CreateTopicClient(path); client.MessagingFactory = factory; return(client); }
/// <summary> /// Create a queue client from a connection string /// </summary> /// <param name="connectionString">Connection string</param> /// <param name="path">Path to the queue entity</param> /// <param name="receiveMode">Receive mode</param> /// <returns>Instace of QueueClient class</returns> public static QueueClient CreateFromConnectionString(string connectionString, string path, ReceiveMode receiveMode) { MessagingFactory factory = MessagingFactory.CreateFromConnectionString(connectionString); QueueClient client = factory.CreateQueueClient(path, receiveMode); client.MessagingFactory = factory; return(client); }