Factory for handling connection
Inheritance: ppatierno.AzureSBLite.Messaging.ClientEntity
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</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>
 internal SubscriptionClient(MessagingFactory factory, string topicPath, string name, ReceiveMode receiveMode)
 {
     this.MessagingFactory = factory;
     this.TopicPath = topicPath;
     this.Name = name;
     this.Mode = receiveMode;
     this.SubscriptionPath = topicPath + "/Subscriptions/" + name;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub</param>
 /// <param name="consumerName">Consumer name</param>
 /// <param name="partitionId">ID for a logical partition of an event hub</param>
 /// <param name="startingDateTimeUtc">Starting date/time offset at which to start receiving messages</param>
 internal EventHubReceiver(MessagingFactory factory, string path, string consumerName, string partitionId, DateTime startingDateTimeUtc)
 {
     this.MessagingFactory = factory;
     this.Path = path;
     this.Name = consumerName;
     this.PartitionId = partitionId;
     this.StartingDateTimeUtc = startingDateTimeUtc;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub</param>
 /// <param name="consumerName">Consumer name</param>
 /// <param name="partitionId">ID for a logical partition of an event hub</param>
 /// <param name="startingOffset">Starting offset at which to start receiving messages</param>
 internal EventHubReceiver(MessagingFactory factory, string path, string consumerName, string partitionId, string startingOffset)
 {
     this.MessagingFactory = factory;
     this.Path = path;
     this.Name = consumerName;
     this.PartitionId = partitionId;
     this.StartingOffset = startingOffset;
     // note : the MaxValue is the default value and it means NO value (as null)
     //        DateTime? nullable types aren't supported in .Net Micro Framework
     this.StartingDateTimeUtc = DateTime.MaxValue;
 }
        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);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="deviceName">Device name</param>
        /// <param name="deviceId">Device ID</param>
        /// <param name="connectionString">Connection string to Service Bus namespace</param>
        /// <param name="eventhubentity">Event Hub entity name</param>
        public IoTClientBase(string deviceName, string deviceId, string connectionString, string eventhubentity)
        {
            this.DeviceName = deviceName;
            this.DeviceId = deviceId;
            this.queue = new Queue<EventData>();
            this.queueEvent = new AutoResetEvent(false);

            ServiceBusConnectionStringBuilder builder = new ServiceBusConnectionStringBuilder(connectionString);
            builder.TransportType = TransportType.Amqp;
            this.factory = MessagingFactory.CreateFromConnectionString(builder.ToString());

            this.client = this.factory.CreateEventHubClient(eventhubentity);
        }
        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();
            });
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Entity path</param>
 internal MessageReceiver(MessagingFactory factory, string path)
 {
     this.MessagingFactory = factory;
     this.Path = path;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="eventHubPath">Path of the event hub</param>
 /// <param name="groupName">Name of the consumer group</param>
 internal EventHubConsumerGroup(MessagingFactory factory, string eventHubPath, string groupName)
 {
     this.MessagingFactory = factory;
     this.EventHubPath = eventHubPath;
     this.GroupName = groupName;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub entity</param>
 /// <param name="receiveMode">Receive mode</param>
 internal QueueClient(MessagingFactory factory, string path, ReceiveMode receiveMode)
 {
     this.MessagingFactory = factory;
     this.Path             = path;
     this.Mode             = receiveMode;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="subscriptionPath">Path to the subscription entity</param>
 /// <param name="receiveMode">Receive mode</param>
 internal SubscriptionClient(MessagingFactory factory, string subscriptionPath, ReceiveMode receiveMode)
 {
     this.MessagingFactory = factory;
     this.SubscriptionPath = subscriptionPath;
     this.Mode             = receiveMode;
 }
Exemple #12
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Entity path</param>
 internal MessageReceiver(MessagingFactory factory, string path)
 {
     this.MessagingFactory = factory;
     this.Path             = path;
 }
Exemple #13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub entity</param>
 internal EventHubClient(MessagingFactory factory, string path)
 {
     this.MessagingFactory = factory;
     this.Path = path;
 }
Exemple #14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path of the event hub</param>
 /// <param name="partitionId">ID for a logical partition of an event hub</param>
 internal EventHubSender(MessagingFactory factory, string path, string partitionId)
 {
     this.MessagingFactory = factory;
     this.Path = path;
     this.PartitionId = partitionId;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="eventHubPath">Path of the event hub</param>
 /// <param name="groupName">Name of the consumer group</param>
 internal EventHubConsumerGroup(MessagingFactory factory, string eventHubPath, string groupName)
 {
     this.MessagingFactory = factory;
     this.EventHubPath     = eventHubPath;
     this.GroupName        = groupName;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="subscriptionPath">Path to the subscription entity</param>
 /// <param name="receiveMode">Receive mode</param>
 internal SubscriptionClient(MessagingFactory factory, string subscriptionPath, ReceiveMode receiveMode)
 {
     this.MessagingFactory = factory;
     this.SubscriptionPath = subscriptionPath;
     this.Mode = receiveMode;
 }
Exemple #17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub entity</param>
 /// <param name="receiveMode">Receive mode</param>
 internal QueueClient(MessagingFactory factory, string path, ReceiveMode receiveMode)
 {
     this.MessagingFactory = factory;
     this.Path = path;
     this.Mode = receiveMode;
 }
Exemple #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub entity</param>
 internal TopicClient(MessagingFactory factory, string path)
 {
     this.MessagingFactory = factory;
     this.Path = path;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub entity</param>
 internal TopicClient(MessagingFactory factory, string path)
 {
     this.MessagingFactory = factory;
     this.Path             = path;
 }
Exemple #20
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path to the event hub entity</param>
 internal EventHubClient(MessagingFactory factory, string path)
 {
     this.MessagingFactory = factory;
     this.Path             = path;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 internal MessageReceiver(MessagingFactory factory)
 {
     this.MessagingFactory = factory;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 /// <param name="path">Path of the event hub</param>
 /// <param name="partitionId">ID for a logical partition of an event hub</param>
 internal EventHubSender(MessagingFactory factory, string path, string partitionId)
 {
     this.MessagingFactory = factory;
     this.Path             = path;
     this.PartitionId      = partitionId;
 }