Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-lambda-stream",
"version": "1.0.30",
"version": "1.0.31",
"description": "Create stream processors with AWS Lambda functions.",
"keywords": [
"aws",
Expand Down
24 changes: 16 additions & 8 deletions src/sinks/eventbridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const publishToEventBridge = ({ // eslint-disable-line import/prefer-defa
maxPublishRequestSize = Number(process.env.PUBLISH_MAX_REQ_SIZE) || Number(process.env.MAX_REQ_SIZE) || 256 * 1024,
batchSize = Number(process.env.PUBLISH_BATCH_SIZE) || Number(process.env.BATCH_SIZE) || 10,
parallel = Number(process.env.PUBLISH_PARALLEL) || Number(process.env.PARALLEL) || 8,
endpointId = process.env.BUS_ENDPOINT_ID,
handleErrors = true,
retryConfig,
step = 'publish',
Expand All @@ -41,14 +42,21 @@ export const publishToEventBridge = ({ // eslint-disable-line import/prefer-defa
} : undefined,
});

const toPublishRequest = (batchUow) => ({
...batchUow,
[publishRequestField]: {
Entries: batchUow.batch
.filter((uow) => uow[publishRequestEntryField])
.map((uow) => uow[publishRequestEntryField]),
},
});
const toPublishRequest = (batchUow) => {
const Entries = batchUow.batch
.filter((uow) => uow[publishRequestEntryField])
.map((uow) => uow[publishRequestEntryField]);

return {
...batchUow,
[publishRequestField]: endpointId ? /* istanbul ignore next */ {

This comment was marked as outdated.

Entries,
EndpointId: endpointId,
} : {
Entries,
},
};
};

const putEvents = (batchUow) => {
if (!batchUow[publishRequestField].Entries.length) {
Expand Down