Decode kinesis data
parent
e84194e809
commit
d4259f1f9e
File diff suppressed because one or more lines are too long
|
|
@ -134,7 +134,6 @@ class AWS {
|
||||||
).ShardIterator;
|
).ShardIterator;
|
||||||
|
|
||||||
core.info(`Task status is ${await getTaskStatus()}`);
|
core.info(`Task status is ${await getTaskStatus()}`);
|
||||||
|
|
||||||
while ((await getTaskStatus()) === 'RUNNING') {
|
while ((await getTaskStatus()) === 'RUNNING') {
|
||||||
const records = await kinesis
|
const records = await kinesis
|
||||||
.getRecords({
|
.getRecords({
|
||||||
|
|
@ -144,7 +143,9 @@ class AWS {
|
||||||
iterator = records.NextShardIterator;
|
iterator = records.NextShardIterator;
|
||||||
if (records.Records.length > 0) {
|
if (records.Records.length > 0) {
|
||||||
for (let index = 0; index < records.Records.length; index++) {
|
for (let index = 0; index < records.Records.length; index++) {
|
||||||
core.info(JSON.stringify(records.Records[index]));
|
core.info(JSON.stringify());
|
||||||
|
const decoder = new TextDecoder('utf-8');
|
||||||
|
core.info(JSON.parse(decoder.decode(records.Records[index].Data)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await new Promise((resolve) => setTimeout(resolve, 3000));
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue