private void WithGetShardIteratorSuccess() { _kinesisClient.GetShardIteratorAsync(Arg.Any <GetShardIteratorRequest>()) .Returns(async info => new GetShardIteratorResponse { ShardIterator = "next-" + (_nextShardIterator - 1).ToString() }); }
private async Task <GetShardIteratorResponse> GetShardIteratorAsync(Checkpoint checkPoint) { GetShardIteratorRequest iteratorRequest = new GetShardIteratorRequest { StreamName = checkPoint.StreamName, ShardId = checkPoint.ShardId, ShardIteratorType = ShardIteratorType.AT_SEQUENCE_NUMBER, StartingSequenceNumber = checkPoint.LastSequenceNumber, }; GetShardIteratorResponse iteratorResponse = await _client.GetShardIteratorAsync(iteratorRequest); return(iteratorResponse); }
private async Task GenerateShardIteratorRequest(KShard shard) { var shardIteratorRequest = new GetShardIteratorRequest() { ShardId = shard.ShardId, ShardIteratorType = shard.ShardIteratorType, StartingSequenceNumber = shard.SequenceNumber, StreamName = _utilities.StreamName }; var response = await _client.GetShardIteratorAsync(shardIteratorRequest, _cancellationTokenSource.Token); shard.SetNextShardIterator(response.ShardIterator); }
private void GetShardIterator() { var request = new GetShardIteratorRequest { ShardId = _settings.ShardId, StreamName = _settings.StreamName, ShardIteratorType = _settings.ShardIteratorType }; if (_settings.AtTimestamp.HasValue) { request.Timestamp = _settings.AtTimestamp.Value; } _kinesisClient.GetShardIteratorAsync(request) .PipeTo(_self, success: result => new GetShardIteratorSuccess(result), failure: ex => new GetShardIteratorFailure(ex)); }
private Amazon.Kinesis.Model.GetShardIteratorResponse CallAWSServiceOperation(IAmazonKinesis client, Amazon.Kinesis.Model.GetShardIteratorRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis", "GetShardIterator"); try { #if DESKTOP return(client.GetShardIterator(request)); #elif CORECLR return(client.GetShardIteratorAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }