Consume kinesis logs while task is RUNNING status
parent
6f6177a915
commit
07051a9c9a
File diff suppressed because one or more lines are too long
|
|
@ -123,19 +123,23 @@ class AWS {
|
||||||
})
|
})
|
||||||
.promise();
|
.promise();
|
||||||
|
|
||||||
while ((await getTaskStatus()) === 'RUNNING') {
|
let iterator = (
|
||||||
const iterator = await kinesis
|
await kinesis
|
||||||
.getShardIterator({
|
.getShardIterator({
|
||||||
ShardIteratorType: 'TRIM_HORIZON',
|
ShardIteratorType: 'TRIM_HORIZON',
|
||||||
StreamName: stream.StreamDescription.StreamName,
|
StreamName: stream.StreamDescription.StreamName,
|
||||||
ShardId: stream.StreamDescription.Shards[0].ShardId,
|
ShardId: stream.StreamDescription.Shards[0].ShardId,
|
||||||
})
|
})
|
||||||
.promise();
|
.promise()
|
||||||
|
).ShardIterator;
|
||||||
|
|
||||||
|
while ((await getTaskStatus()) === 'RUNNING') {
|
||||||
const records = await kinesis
|
const records = await kinesis
|
||||||
.getRecords({
|
.getRecords({
|
||||||
ShardIterator: iterator.ShardIterator,
|
ShardIterator: iterator.ShardIterator,
|
||||||
})
|
})
|
||||||
.promise();
|
.promise();
|
||||||
|
iterator = records.NextShardIterator;
|
||||||
core.info(Buffer.from(records.Records[0].Data).toString('base64'));
|
core.info(Buffer.from(records.Records[0].Data).toString('base64'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue