@siglo/sqs 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +162 -2
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Jerico de guzman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,163 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @siglo/sqs Adapter Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@siglo/sqs` provides an AWS SQS batch consumer adapter for executing `Siglo` workflows. It is optimized for AWS Lambda event source mappings and standalone long-polling worker processes, implementing AWS partial batch failure protocols (`ReportBatchItemFailures`), message deduplication, and tenant namespace extraction.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Overview & Architecture
|
|
8
|
+
|
|
9
|
+
When AWS Lambda is triggered by an SQS queue, it passes a batch of records (`SQSEvent`). If one message in the batch fails, returning an uncaught exception causes the entire batch to be retried by AWS, resulting in duplicate processing of previously successful messages.
|
|
10
|
+
|
|
11
|
+
`@siglo/sqs` solves this using AWS SQS Partial Batch Responses:
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart TD
|
|
15
|
+
SQS["AWS SQS"] -->|Batch of N records| Lambda["AWS Lambda Trigger"]
|
|
16
|
+
Lambda --> Handler["createSqsBatchHandler<br/>• Iterates event.Records<br/>• Checks IdempotencyStore<br/>• Parses JSON Record Body<br/>• Executes Siglo"]
|
|
17
|
+
Handler --> Split{Record Result}
|
|
18
|
+
Split -->|Success Message| SSuccess["• Complete Idemp Key<br/>• Increment Count"]
|
|
19
|
+
Split -->|Failed Message| SFail["• Fail Idemp Key<br/>• Append to batchItemFailures"]
|
|
20
|
+
SSuccess --> BatchRes["Return Batch Result<br/>{ batchItemFailures: [...] }"]
|
|
21
|
+
SFail --> BatchRes
|
|
22
|
+
BatchRes --> Final["SQS deletes succeeded records<br/>SQS retries only failed items"]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Installation & Requirements
|
|
28
|
+
|
|
29
|
+
Install `@siglo/sqs`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @siglo/core @siglo/sqs
|
|
33
|
+
npm install --save-dev @types/aws-lambda
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Peer dependency matrix:
|
|
37
|
+
- `Siglo`: `*` (v1.0.0+)
|
|
38
|
+
- `@aws-sdk/client-sqs`: `^3.0.0` (optional if running in AWS Lambda runtime)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 3. API Reference
|
|
43
|
+
|
|
44
|
+
### `createSqsBatchHandler(workflow, options)`
|
|
45
|
+
|
|
46
|
+
Creates an AWS Lambda-compliant batch processor function:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
function createSqsBatchHandler<TInput = any, TOutput = any>(
|
|
50
|
+
workflow: Flow<TInput, TOutput>,
|
|
51
|
+
options?: SigloSqsOptions<TInput, TOutput>
|
|
52
|
+
): (event: SigloSqsEvent) => Promise<SqsBatchResponse>;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### TypeScript Interfaces
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
export interface SigloSqsRecord {
|
|
59
|
+
messageId: string;
|
|
60
|
+
receiptHandle: string;
|
|
61
|
+
body: string;
|
|
62
|
+
attributes?: Record<string, string>;
|
|
63
|
+
messageAttributes?: Record<string, any>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface SigloSqsEvent {
|
|
67
|
+
Records: SigloSqsRecord[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface SqsBatchResponse {
|
|
71
|
+
batchItemFailures: Array<{ itemIdentifier: string }>;
|
|
72
|
+
processedCount: number;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 4. Configuration Options (`SigloSqsOptions`)
|
|
79
|
+
|
|
80
|
+
| Option | Type | Default | Description |
|
|
81
|
+
| :--- | :--- | :--- | :--- |
|
|
82
|
+
| `input` | `(record: SigloSqsRecord) => Promise<TInput> \| TInput` | `JSON.parse(record.body)` | Custom mapper transforming an SQS record into workflow parameters. |
|
|
83
|
+
| `output` | `(result: any, record: SigloSqsRecord) => Promise<TOutput> \| TOutput` | `result` | Custom post-processor for step result. |
|
|
84
|
+
| `idempotencyStore` | `IdempotencyStore` | `undefined` | Distributed store to deduplicate across re-deliveries. |
|
|
85
|
+
| `idempotencyTtlMs` | `number` | `86400000` (24h) | Time-to-live for idempotency lock. |
|
|
86
|
+
| `timeout` | `number` | `undefined` | SLA execution timeout per record in milliseconds. |
|
|
87
|
+
| `namespace` | `string \| ((record: SigloSqsRecord) => string \| undefined)` | `record.messageAttributes.namespace` | Namespace extractor for multi-tenant isolation. |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 5. AWS Lambda Configuration: `ReportBatchItemFailures`
|
|
92
|
+
|
|
93
|
+
To enable partial batch responses in AWS Lambda:
|
|
94
|
+
1. In the AWS Lambda Console, navigate to your SQS Trigger configuration.
|
|
95
|
+
2. Under **Additional settings**, check the option: **Report batch item failures**.
|
|
96
|
+
3. In AWS SAM / CloudFormation / Serverless Framework / CDK:
|
|
97
|
+
```yaml
|
|
98
|
+
FunctionEventSource:
|
|
99
|
+
Type: SQS
|
|
100
|
+
Properties:
|
|
101
|
+
Queue: !GetAtt MyQueue.Arn
|
|
102
|
+
FunctionResponseTypes:
|
|
103
|
+
- ReportBatchItemFailures
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
When this is enabled, returning `{ batchItemFailures: [{ itemIdentifier: 'msg-01' }] }` tells AWS SQS to delete all successful messages in the batch from the queue, while leaving only `msg-01` in the queue to be retried or routed to the Dead Letter Queue (DLQ).
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 6. Complete AWS Lambda Production Example
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
import { SQSEvent, SQSBatchResponse, Context } from 'aws-lambda';
|
|
114
|
+
import { Step, flow } from '@siglo/core';
|
|
115
|
+
import { createSqsBatchHandler } from '@siglo/sqs';
|
|
116
|
+
import { PostgresIdempotencyStore } from '@siglo/postgres';
|
|
117
|
+
import { Pool } from 'pg';
|
|
118
|
+
|
|
119
|
+
// 1. Initialize PostgreSQL Connection Pool outside handler
|
|
120
|
+
const pool = new Pool({
|
|
121
|
+
connectionString: process.env.DATABASE_URL,
|
|
122
|
+
max: 5,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const idempotencyStore = new PostgresIdempotencyStore({ client: pool });
|
|
126
|
+
|
|
127
|
+
// 2. Define Notification Workflow
|
|
128
|
+
interface NotificationPayload {
|
|
129
|
+
userId: string;
|
|
130
|
+
template: string;
|
|
131
|
+
destination: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const formatNotification = Step.create('formatNotification', async (param: NotificationPayload) => {
|
|
135
|
+
return { formattedBody: `Hello user ${param.userId}, template ${param.template}` };
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const dispatchEmail = Step.create('dispatchEmail', async (param: any) => {
|
|
139
|
+
// Send email via AWS SES or external provider
|
|
140
|
+
return { dispatched: true, messageRef: `ses_${Date.now()}` };
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const notificationFlow = flow(formatNotification, dispatchEmail);
|
|
144
|
+
|
|
145
|
+
// 3. Create SQS Batch Handler
|
|
146
|
+
const sqsHandler = createSqsBatchHandler(notificationFlow, {
|
|
147
|
+
idempotencyStore,
|
|
148
|
+
timeout: 10000, // 10-second deadline per message
|
|
149
|
+
namespace: (record) => record.messageAttributes?.tenantId?.stringValue,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// 4. Export AWS Lambda Handler
|
|
153
|
+
export const handler = async (event: SQSEvent, context: Context): Promise<SQSBatchResponse> => {
|
|
154
|
+
context.callbackWaitsForEmptyEventLoop = false;
|
|
155
|
+
|
|
156
|
+
const response = await sqsHandler(event);
|
|
157
|
+
console.log(`Processed ${response.processedCount} messages. Failures: ${response.batchItemFailures.length}`);
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
batchItemFailures: response.batchItemFailures,
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Flow, IdempotencyStore } from '@siglo/core';
|
|
2
|
+
export interface SigloSqsRecord {
|
|
3
|
+
messageId: string;
|
|
4
|
+
receiptHandle: string;
|
|
5
|
+
body: string;
|
|
6
|
+
attributes?: Record<string, string>;
|
|
7
|
+
messageAttributes?: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
export interface SigloSqsEvent {
|
|
10
|
+
Records: SigloSqsRecord[];
|
|
11
|
+
}
|
|
12
|
+
export interface SigloSqsOptions<TInput = any, TOutput = any> {
|
|
13
|
+
input?: (record: SigloSqsRecord) => Promise<TInput> | TInput;
|
|
14
|
+
output?: (result: any, record: SigloSqsRecord) => Promise<TOutput> | TOutput;
|
|
15
|
+
idempotencyStore?: IdempotencyStore;
|
|
16
|
+
idempotencyTtlMs?: number;
|
|
17
|
+
timeout?: number;
|
|
18
|
+
namespace?: string | ((record: SigloSqsRecord) => string | undefined);
|
|
19
|
+
}
|
|
20
|
+
export interface SqsBatchResponse {
|
|
21
|
+
batchItemFailures: Array<{
|
|
22
|
+
itemIdentifier: string;
|
|
23
|
+
}>;
|
|
24
|
+
processedCount: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates an AWS Lambda compatible SQS batch message handler for rivulet workflows.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createSqsBatchHandler<TInput = any, TOutput = any>(workflow: Flow<TInput, TOutput>, options?: SigloSqsOptions<TInput, TOutput>): (event: SigloSqsEvent) => Promise<SqsBatchResponse>;
|
|
30
|
+
export type RivuletSqsRecord = SigloSqsRecord;
|
|
31
|
+
export type RivuletSqsEvent = SigloSqsEvent;
|
|
32
|
+
export type RivuletSqsOptions<TInput = any, TOutput = any> = SigloSqsOptions<TInput, TOutput>;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.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EAC/B,OAAO,GAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAM,WAEzB,aAAa,KAAG,OAAO,CAAC,gBAAgB,CAAC,CA2DjE;AAGD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAC5C,MAAM,MAAM,iBAAiB,CAAC,MAAM,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSqsBatchHandler = createSqsBatchHandler;
|
|
4
|
+
function unwrapContext(obj) {
|
|
5
|
+
if (!obj || typeof obj !== 'object') {
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
const clean = {};
|
|
9
|
+
for (const key of Object.keys(obj)) {
|
|
10
|
+
if (key.startsWith('$')) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const val = typeof obj[key] === 'function' ? (obj[key].val !== undefined ? obj[key].val : (obj[key].length === 0 ? obj[key]() : obj[key])) : obj[key];
|
|
14
|
+
clean[key] = val;
|
|
15
|
+
}
|
|
16
|
+
return clean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates an AWS Lambda compatible SQS batch message handler for rivulet workflows.
|
|
20
|
+
*/
|
|
21
|
+
function createSqsBatchHandler(workflow, options = {}) {
|
|
22
|
+
return async (event) => {
|
|
23
|
+
const batchItemFailures = [];
|
|
24
|
+
let processedCount = 0;
|
|
25
|
+
for (const record of event.Records || []) {
|
|
26
|
+
const idempKey = `sqs:${record.messageId}`;
|
|
27
|
+
if (options.idempotencyStore) {
|
|
28
|
+
const status = await options.idempotencyStore.claim(idempKey, options.idempotencyTtlMs);
|
|
29
|
+
if (status === 'completed') {
|
|
30
|
+
processedCount++;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
let parsedInput = {};
|
|
36
|
+
if (options.input) {
|
|
37
|
+
parsedInput = await options.input(record);
|
|
38
|
+
}
|
|
39
|
+
else if (record.body) {
|
|
40
|
+
try {
|
|
41
|
+
parsedInput = JSON.parse(record.body);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
parsedInput = { body: record.body };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
let namespace;
|
|
48
|
+
if (typeof options.namespace === 'function') {
|
|
49
|
+
namespace = options.namespace(record);
|
|
50
|
+
}
|
|
51
|
+
else if (options.namespace) {
|
|
52
|
+
namespace = options.namespace;
|
|
53
|
+
}
|
|
54
|
+
else if (record.messageAttributes?.namespace?.stringValue) {
|
|
55
|
+
namespace = record.messageAttributes.namespace.stringValue;
|
|
56
|
+
}
|
|
57
|
+
const execOptions = {
|
|
58
|
+
timeout: options.timeout,
|
|
59
|
+
namespace,
|
|
60
|
+
};
|
|
61
|
+
const rawResult = await workflow.run(parsedInput, execOptions);
|
|
62
|
+
const cleanResult = unwrapContext(rawResult);
|
|
63
|
+
if (options.idempotencyStore) {
|
|
64
|
+
await options.idempotencyStore.complete(idempKey, cleanResult);
|
|
65
|
+
}
|
|
66
|
+
processedCount++;
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
if (options.idempotencyStore) {
|
|
70
|
+
await options.idempotencyStore.fail(idempKey, err);
|
|
71
|
+
}
|
|
72
|
+
batchItemFailures.push({ itemIdentifier: record.messageId });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return { batchItemFailures, processedCount };
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AA8CA,sDA+DC;AAt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AAC;gBACpE,MAAM,WAAW,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;gBAE7C,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;oBAC3B,MAAM,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;gBACnE,CAAC;gBAED,cAAc,EAAE,CAAC;YACrB,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAChB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;oBAC3B,MAAM,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBACvD,CAAC;gBACD,iBAAiB,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;YACjE,CAAC;QACL,CAAC;QAED,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC;IACjD,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siglo/sqs",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AWS SQS message batch processor and event consumer adapter for Siglo workflows",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"registry": "https://registry.npmjs.org/"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -p tsconfig.json",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"test": "npm run build && mocha -r tsx 'src/**/*.test.ts'"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/jsoftgem/siglo.git",
|
|
33
|
+
"directory": "packages/sqs"
|
|
34
|
+
},
|
|
35
|
+
"author": "Jerico de Guzman",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/jsoftgem/siglo/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/jsoftgem/siglo#readme",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@siglo/core": "^1.0.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@aws-sdk/client-sqs": "^3.0.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@aws-sdk/client-sqs": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/chai": "^5.2.3",
|
|
54
|
+
"@types/mocha": "^10.0.10",
|
|
55
|
+
"@types/node": "^26.6.5",
|
|
56
|
+
"chai": "^3.5.0",
|
|
57
|
+
"mocha": "^12.0.3",
|
|
58
|
+
"tsx": "^4.23.15",
|
|
59
|
+
"typescript": "~5.7.0"
|
|
60
|
+
}
|
|
61
|
+
}
|