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(); }); }