mhart / kinesalite

An implementation of Amazon's Kinesis built on LevelDB
MIT License
808 stars 86 forks source link

SerializationException thrown when CBOR is enabled in java client #101

Closed pulasthibandara closed 1 year ago

pulasthibandara commented 4 years ago

Summary:

Since CBOR is supported in 3.3.x accrding to: https://github.com/mhart/kinesalite/commit/94141667137fa17db2d2248596536d142735f53c. I tried testing with CBOR enabled in the java sdk. However, I ran into the following error when trying to invoke putRecord

Start of structure or map found where not expected. (Service: AmazonKinesis; Status Code: 400; Error Code: SerializationException; Request ID: 0090d3d0-c631-11ea-9dc3-37f7997b638f; Proxy: null)

com.amazonaws.services.kinesis.model.AmazonKinesisException: Start of structure or map found where not expected. (Service: AmazonKinesis; Status Code: 400; Error Code: SerializationException; Request ID: 0090d3d0-c631-11ea-9dc3-37f7997b638f; Proxy: null)

Versions:

kinesalite: 3.3.1 aws-java-sdk-kinesi: 1.11.799

Reproduce:

Example Scala code:

val kinesisClient: AmazonKinesisAsync = AmazonKinesisAsyncClientBuilder
      .standard()
      .withEndpointConfiguration(new EndpointConfiguration("http://localhost:5678", ""))
      .build()

val createStream = kinesisClient.createStream("test1", 1)

Thread.sleep(2000)

// Following throws exception
val response = kinesisClient.putRecord("test1", ByteBuffer.wrap("test".getBytes(Charset.forName("UTF-8"))), "test")

Expected

The putRecord operation to succeed when CBOR is enabled.