The consumer module defines the function for the queue to process the async events.
For more information about this feature, see async events.
If you are using @forge/events version 1.x, the consumer module uses a resolver property instead of function. See Upgrade to @forge/events major version 2 for migration details.
| Property | Type | Required | Description |
|---|---|---|---|
key |
| Yes |
A key for the module, which other modules can refer to. Must be unique within the manifest. Regex: |
queue | string | Yes |
The name of the queue for which the consumer processes the events asynchronously. |
function | string | Yes (when using @forge/events v2+) | A reference to the function module that will be invoked when events are pushed to the queue of this consumer module. Use this property when using @forge/events version 2 or later. |
resolver | object | Yes (when using @forge/events v1.x) |
Deprecated. Used with Contains the following properties:
|
crossVersion | boolean | No | When set to Note that event processing begins after the This is a temporary property, and will be removed after |
The following examples show the two supported syntaxes for the consumer module.
@forge/events v2+ (recommended)
1 2modules: consumer: - key: my-queue-consumer queue: my-queue function: myQueueFunction function: - key: myQueueFunction handler: index.handler
@forge/events v1.x (deprecated)
1 2modules: consumer: - key: my-queue-consumer queue: my-queue resolver: function: myQueueFunction method: my-queue-listener function: - key: myQueueFunction handler: index.handler
See Upgrade to @forge/events major version 2 for details on migrating from v1.x to v2+.
Rate this page: