public EventHubsDataPusher(DataPusherConfiguration configuration, IDatasourceRecordSerializer recordSerializer)
        {
            _recordSerializer = recordSerializer;

            _processorCount  = Environment.ProcessorCount;
            _eventHubClients = new List <EventHubClient>(_processorCount);

            var factory = MessagingFactory.Create(
                "sb://" + configuration.EventHubNamespace + ".servicebus.windows.net/",
                new MessagingFactorySettings
            {
                TokenProvider =
                    TokenProvider.CreateSharedAccessSignatureTokenProvider(configuration.EventHubSharedAccessKeyName,
                                                                           configuration.EventHubSharedAccessKey),
                TransportType         = TransportType.Amqp,
                AmqpTransportSettings = new AmqpTransportSettings()
            });

            for (var i = 0; i < _processorCount; i++)
            {
                var newConnnection = factory.CreateEventHubClient(configuration.EventHubPath);

                _eventHubClients.Add(newConnnection);
            }

            Log.DebugFormat("Initialized {0} Event Hub clients", _processorCount);
        }
Ejemplo n.º 2
0
 public SqlDatabaseEventProcessor()
 {
     //We have to get the config from the container unfortunately since this class
     //is being constructed by the event processor host
     _cloudConfig = ServiceLocator.Current.GetInstance <CloudConfiguration>();
     _datasourceRecordSerializer = ServiceLocator.Current.GetInstance <IDatasourceRecordSerializer>();
 }
Ejemplo n.º 3
0
        public DeviceDataBlobWriter(CloudConfiguration configuration, IDatasourceRecordSerializer serializer)
        {
            _config = configuration;
            //_repository = repository;
            _serializer = serializer;

            _connectionString = _config.DataStorageConfiguration.GetConnectionString();

            // Retrieve storage account from connection string.
            _storageAccount = CloudStorageAccount.Parse(_connectionString);

            // Create the blob client.
            CloudBlobClient blobClient = _storageAccount.CreateCloudBlobClient();
        }
        public DeviceDataBlobWriter(CloudConfiguration configuration, IDatasourceRecordSerializer serializer)
        {
            _config = configuration;
            //_repository = repository;
            _serializer = serializer;

            _connectionString = _config.DataStorageConfiguration.GetConnectionString();

            // Retrieve storage account from connection string.
            _storageAccount = CloudStorageAccount.Parse(_connectionString);
            
            // Create the blob client.
            CloudBlobClient blobClient = _storageAccount.CreateCloudBlobClient();

            
        }
Ejemplo n.º 5
0
 public ReactiveTest(CloudConfiguration configuration, IDatasourceRecordSerializer serializer)
 {
     _config     = configuration;
     _serializer = serializer;
 }
 public ReactiveTest(CloudConfiguration configuration, IDatasourceRecordSerializer serializer)
 {
     _config = configuration;
     _serializer = serializer;
 }
Ejemplo n.º 7
0
 public MsmqRecordRepository(IDatasourceRecordSerializer recordSerializer, DataCollectorConfiguration configuration)
 {
     _recordSerializer           = recordSerializer;
     _queueName                  = string.Format(".\\private$\\{0}", configuration.MsmqQueueName.ToLower());
     _dataCollectorConfiguration = configuration;
 }
Ejemplo n.º 8
0
 public ServiceBusQueueDataPusher(DataPusherConfiguration configuration, IDatasourceRecordSerializer recordSerializer)
 {
     _config           = configuration;
     _recordSerializer = recordSerializer;
     _factory          = MessagingFactory.CreateFromConnectionString(_config.ReceiverQueue.GetConnectionString());
 }
Ejemplo n.º 9
0
 public HttpSendEventProcessor()
 {
     //We have to get the config from the container unfortunately since this class
     //is being constructed by the event processor host
     _datasourceRecordSerializer = ServiceLocator.Current.GetInstance <IDatasourceRecordSerializer>();
 }