amazon-kinesis-kpl

How to convert a Data Class to ByteBuffer in Kotlin?

和自甴很熟 提交于 2021-01-05 07:50:28
问题 I am trying to use Kinesis, which expects data in byte buffer format. All the examples I have seen so far are in Java and pass simple strings. Can anybody give an idea of how to convert a kotlin data class to bytebuffer? e.g. data class abc ( var a: Long, var b: String, var c: Double ) 回答1: Check the below method fun toByteArray(): ByteArray? { val size: Int = 8 + 8 + string.Size val byteBuffer = ByteBuffer.allocate(size) .put(long) //long veriable .put(double) // double veriable .put(string)

Call REST API for Amazon Kinesis with Setting up API Gateway

混江龙づ霸主 提交于 2019-12-18 06:57:31
问题 I am trying to send a HTTP Post Request to put a record into Amazon Kinesis Stream. There are several ways (Kinesis Client, KPL, setting up AWS Gateway as Kinesis Proxy). I saw this document about Kinesis PutRecord API http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html POST / HTTP/1.1 Host: kinesis.<region>.<domain> Content-Length: <PayloadSizeBytes> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Authorization: <AuthParams> Connection: Keep-Alive

Kinesis lambda DynamoDB

ε祈祈猫儿з 提交于 2019-12-11 05:35:48
问题 I am learning the AWS services for a use case. After going through the docs I came came up with the a simple flow. I want to ingest data into the Kinesis streams by using the Streams API and the KPL. I use the example putRecord method to ingest data to the streams. I am ingesting the this JSON to the stream - {"userid":1234,"username":"jDoe","firstname":"John","lastname":"Doe"} Once the data is ingested i get the following response in putRecordResult - Put Result :{ShardId: shardId

Call REST API for Amazon Kinesis with Setting up API Gateway

眉间皱痕 提交于 2019-11-29 11:35:31
I am trying to send a HTTP Post Request to put a record into Amazon Kinesis Stream. There are several ways (Kinesis Client, KPL, setting up AWS Gateway as Kinesis Proxy). I saw this document about Kinesis PutRecord API http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html POST / HTTP/1.1 Host: kinesis.<region>.<domain> Content-Length: <PayloadSizeBytes> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Authorization: <AuthParams> Connection: Keep-Alive X-Amz-Date: <Date> X-Amz-Target: Kinesis_20131202.PutRecord { "StreamName": "exampleStreamName", "Data