Factory for handling connection
Inheritance: ppatierno.AzureSBLite.Messaging.ClientEntity
Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 /// <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;
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
        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();
            });
        }
Ejemplo n.º 7
0
        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();
            });
        }
Ejemplo n.º 8
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;
 }
Ejemplo n.º 9
0
 /// <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;
 }
Ejemplo n.º 10
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;
 }
Ejemplo n.º 11
0
 /// <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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 15
0
 /// <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;
 }
Ejemplo n.º 16
0
 /// <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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 19
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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">Messaging factory</param>
 internal MessageReceiver(MessagingFactory factory)
 {
     this.MessagingFactory = factory;
 }
Ejemplo n.º 22
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;
 }