0

我明白了

2016-03-21 10:17:19.915081] [0x00007f539b023740] [error] [retrier.cc:59] PutRecords failed: {"__type":"SerializationException"}

使用以下 Java 堆栈跟踪:

Caused by: com.amazonaws.services.kinesis.producer.UserRecordFailedException
at com.amazonaws.services.kinesis.producer.KinesisProducer$MessageHandler.onPutRecordResult(KinesisProducer.java:188)
at com.amazonaws.services.kinesis.producer.KinesisProducer$MessageHandler.access$000(KinesisProducer.java:127)
at com.amazonaws.services.kinesis.producer.KinesisProducer$MessageHandler$1.run(KinesisProducer.java:134)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

怎么了?

4

1 回答 1

0

在我们的例子中,原因是PartitionKey包含的引号字符 ( ")。这不是文档所禁止的,而是可能是 KPL 中的 c++ 代码中的“字符串注入”问题。所以在 callkp.addUserRecord(streamName, partitionKey, data);中,确保它partitionKey不包含任何引号字符。

于 2016-03-21T09:22:04.567 回答