Skip to content

Commit

Permalink
feat: batching on max size in bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravudia committed Mar 14, 2024
1 parent bf8f93f commit a7f43cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cdk/v2/destinations/movable_ink/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
MAX_REQUEST_SIZE_IN_BYTES: 13500,
};
7 changes: 6 additions & 1 deletion src/cdk/v2/destinations/movable_ink/rtWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ bindings:
exportAll: true
- name: base64Convertor
path: ../../../../v0/util
- name: BatchUtils
path: '@rudderstack/workflow-engine'
- path: ./config

steps:
- name: validateInput
Expand Down Expand Up @@ -38,7 +41,9 @@ steps:
- name: batchSuccessfulEvents
description: Batches the successfulEvents
template: |
let batches = [$.outputs.successfulEvents];
let batches = $.BatchUtils.chunkArrayBySizeAndLength(
$.outputs.successfulEvents, {maxSizeInBytes: $.MAX_REQUEST_SIZE_IN_BYTES}).items;
batches@batch.({
"batchedRequest": {
"body": {
Expand Down

0 comments on commit a7f43cc

Please sign in to comment.