Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
The data which I sent using JS code to AWS Kinesis is not stored in correct format

I was trying to send data using the following code it is not sending the data in correct format. It is storing some gibberish in S3.

import { KinesisClient, PutRecordCommand } from "@aws-sdk/client-kinesis";

import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity";
import { Component } from '@angular/core';
import {
  fromCognitoIdentityPool,
} from "@aws-sdk/credential-provider-cognito-identity";


client = new KinesisClient({
      region: REGION,
      credentials: fromCognitoIdentityPool({
        client: new CognitoIdentityClient({ region: REGION }),
        identityPoolId: "" // IDENTITY_POOL_ID
      })
    });

    var recordData= JSON.stringify({
      blog: window.location.href,
      Sample: 'Srini',
      time: new Date()
    });

const data = await this.client.send(new PutRecordCommand({
        Data: recordData,
        PartitionKey: '1',
        StreamName: 'my-stream-kinesis'
      }));
      const data1 = await this.client.send(new PutRecordCommand({
        Data: Uint8Array.from(recordData),
        PartitionKey: '1',
        StreamName: 'my-stream-kinesis'
      }));

The following command is actually sending correct data.

 aws kinesis put-record --stream-name my-stream-kinesis --partition-key 123 --data eyJhYmNkIjoiU0FNUExFIn0=

What is wrong in the code?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!