public abstract CreateTopicClient ( string path ) : ppatierno.AzureSBLite.Messaging.TopicClient | ||
path | string | Path to the entity |
리턴 | ppatierno.AzureSBLite.Messaging.TopicClient |
/// <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); }
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(); }); }