public abstract CreateSubscriptionClient ( string topicPath, string name ) : ppatierno.AzureSBLite.Messaging.SubscriptionClient | ||
topicPath | string | Path to the topic related entity |
name | string | Name of the subscription |
return | ppatierno.AzureSBLite.Messaging.SubscriptionClient |
/// <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); }
public MainPage() { this.InitializeComponent(); builder = new ServiceBusConnectionStringBuilder(this.ConnectionString); builder.TransportType = TransportType.Amqp; factory = MessagingFactory.CreateFromConnectionString(this.ConnectionString); topicClient = factory.CreateTopicClient("topic2"); subClient = factory.CreateSubscriptionClient("topic2", "sub1", ReceiveMode.PeekLock); }
public Example2View() { this.InitializeComponent(); builder = new ServiceBusConnectionStringBuilder(this.ConnectionString); builder.TransportType = TransportType.Amqp; factory = MessagingFactory.CreateFromConnectionString(this.ConnectionString); topicClient = factory.CreateTopicClient("topic3"); subClient = factory.CreateSubscriptionClient("topic3", "sub1", ReceiveMode.PeekLock); Task.Run(async () => { await RunAsync(); }); }
public MainPage() { this.InitializeComponent(); //Amqp.Trace.TraceLevel = Amqp.TraceLevel.Frame | Amqp.TraceLevel.Verbose; //Amqp.Trace.TraceListener = (f, a) => Debug.WriteLine(DateTime.Now.ToString("[hh:ss.fff]") + " " + Fx.Format(f, a)); builder = new ServiceBusConnectionStringBuilder(this.ConnectionString); builder.TransportType = TransportType.Amqp; factory = MessagingFactory.CreateFromConnectionString(this.ConnectionString); topicClient = factory.CreateTopicClient("topic1"); subClient = factory.CreateSubscriptionClient("topic1", "BankerChannel", ReceiveMode.PeekLock); factory.Close(); Task.Run(async () => { await RunAsync(); }); }