/// <summary> /// Send json payload /// </summary> /// <param name="client"></param> /// <param name="payload"></param> /// <param name="contentType"></param> /// <param name="partitionKey"></param> public static Task SendAsync(this IEventQueueClient client, JToken payload, string contentType, string partitionKey) { return(client.SendAsync(payload, new Dictionary <string, string> { [CommonProperties.EventSchemaType] = contentType }, partitionKey)); }
protected override Task ExecuteAsync(CancellationToken stoppingToken) { _datasourcesFabric = _serviceScope.ServiceProvider.GetService <IDatasourcesFabric>(); _configProvider = _serviceScope.ServiceProvider.GetService <ISystemConfig>(); _eventQueue = _serviceScope.ServiceProvider.GetService <IEventQueueClient>(); _gameStorage = _serviceScope.ServiceProvider.GetService <IGameStorageClient>(); _processor = new DataprocessorBase(_configProvider, _eventQueue, _gameStorage); _dssContainer = new DatasourcesContainer(_datasourcesFabric, _configProvider, _eventQueue, _gameStorage); Task.Factory.StartNew((obj) => _dssContainer.Start(), stoppingToken, TaskCreationOptions.LongRunning); _processor.Start(); return(Task.FromResult(1)); }
/// <summary> /// Send json payload /// </summary> /// <param name="client"></param> /// <param name="payload"></param> /// <param name="properties"></param> /// <param name="partitionKey"></param> public static Task SendAsync(this IEventQueueClient client, JToken payload, IDictionary <string, string> properties, string partitionKey = null) { return(client.SendAsync(Encoding.UTF8.GetBytes(payload.ToString()), properties, partitionKey)); }