Conversation
Send set of records to Kinesis stream
|
@JoseLuisSR If you don't have any concerns, can you kindly merge this? |
|
@JoseLuisSR Bumping this up |
| try { | ||
| putRecordsRequestEntryList.add(PutRecordsRequestEntry.builder() | ||
| .data(SdkBytes.fromByteArray(String.valueOf(jsonArray.get(i)).getBytes(StandardCharsets.UTF_8))) | ||
| .partitionKey(context.getParameter(KINESIS_PARTITION_KEY) + "-" + i).build()); |
There was a problem hiding this comment.
Each record could specify the Data, ExplicitHashKey, and Partition Key.
Could you please get these fields from the JSON and use them to build PutReecordsRequestEntry.
| JSONArray jsonArray = new JSONArray(tempPayload); | ||
| List<PutRecordsRequestEntry> putRecordsRequestEntryList = new ArrayList<>(); | ||
| PutRecordsRequest putRecordsRequest = null; | ||
| for (int i = 0; i < jsonArray.length(); i++) { |
There was a problem hiding this comment.
The limit of records is 500.
Please add validation to not exceed this limit.
| } catch (JSONException e) { | ||
| e.printStackTrace(); | ||
| } | ||
| putRecordsRequest = PutRecordsRequest.builder() |
There was a problem hiding this comment.
Looks like you are building PutRecordRequest for each record in the array.
I guess is better to create PutRecordRequest once with the List<PutRecordsRequestEntry and streamName.
JoseLuisSR
left a comment
There was a problem hiding this comment.
Hi @samarr
Thank you to send it PR.
I agree with you to create another Java Sampler to produce put records on Kinesis Data Stream.
I suggested some changes to improve the solution.
Please let me know if you have doubts.
Have created a Kinesis put records sampler as per the request - #3. Please check and share any feedback you have.