You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+139Lines changed: 139 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ They implement the following public methods:
32
32
*`messageTypeField` - which field in the message describes the type of a message. This field needs to be defined as `z.literal` in the schema and is used for resolving the correct schema for validation
33
33
*`locatorConfig` - configuration for resolving existing queue and/or topic. Should not be specified together with the `creationConfig`.
34
34
*`creationConfig` - configuration for queue and/or topic to create, if one does not exist. Should not be specified together with the `locatorConfig`;
35
+
*`policyConfig` - SQS only - configuration for queue access policies (see [SQS Policy Configuration](#sqs-policy-configuration) for more information);
35
36
*`deletionConfig` - automatic cleanup of resources;
36
37
*`handlerSpy` - allow awaiting certain messages to be published (see [Handler Spies](#handler-spies) for more information);
37
38
*`logMessages` - add logs for processed messages.
@@ -99,6 +100,7 @@ Multi-schema consumers support multiple message types via handler configs. They
99
100
*`locatorConfig` - configuration for resolving existing queue and/or topic. Should not be specified together with the `creationConfig`.
100
101
*`creationConfig` - configuration for queue and/or topic to create, if one does not exist. Should not be specified together with the `locatorConfig`.
101
102
*`subscriptionConfig` - SNS SQS consumer only - configuration for SNS -> SQS subscription to create, if one doesn't exist.
103
+
*`policyConfig` - SQS only - configuration for queue access policies (see [SQS Policy Configuration](#sqs-policy-configuration) for more information);
102
104
*`deletionConfig` - automatic cleanup of resources;
103
105
*`consumerOverrides` – available only for SQS consumers;
104
106
*`deadLetterQueue` - available only for SQS and SNS consumers (see [Dead Letter Queue](#dead-letter-queue) for more information);
@@ -237,6 +239,143 @@ Both publishers and consumers accept a queue name and configuration as parameter
237
239
238
240
If you do not want to create a new queue/topic, you can set `queueLocator` field for `queueConfiguration`. In that case `message-queue-toolkit` will not attempt to create a new queue or topic, and instead throw an error if they don't already exist.
239
241
242
+
## SQS Policy Configuration
243
+
244
+
SQS queues can be configured with access policies to control who can send messages to and receive messages from the queue. The `policyConfig` parameter allows you to define these policies when creating or updating SQS queues.
245
+
246
+
### Policy Configuration Options
247
+
248
+
The `policyConfig` parameter accepts the following structure:
> **_NOTE:_** See [SqsPermissionConsumer.spec.ts](./packages/sqs/test/consumers/SqsPermissionConsumer.spec.ts) and [SqsPermissionPublisher.spec.ts](./packages/sqs/test/publishers/SqsPermissionPublisher.spec.ts) for practical examples of policy configuration tests.
378
+
240
379
## Handler Spies
241
380
242
381
In certain cases you want to await until certain publisher publishes a message, or a certain handler consumes a message. For that you can use handler spy functionality, built into `message-queue-toolkit` directly.
0 commit comments