Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): dead letter queue support for queues #6060

Merged
merged 69 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
c788de6
feat(sdk): adding dlq
marciocadev Mar 25, 2024
39be2aa
dql for aws
marciocadev Mar 25, 2024
ee98bb9
Merge branch 'main' into dlq
monadabot Mar 25, 2024
0eab8e5
chore: self mutation (build.diff)
monadabot Mar 25, 2024
180ba2b
Update libs/wingsdk/src/cloud/queue.ts
marciocadev Mar 25, 2024
1ac8443
Merge branch 'main' into dlq
monadabot Mar 25, 2024
d451864
chore: self mutation (build.diff)
monadabot Mar 25, 2024
52eff2b
Update libs/wingsdk/src/cloud/queue.ts
marciocadev Mar 25, 2024
96fe4ef
Update libs/wingsdk/src/cloud/queue.ts
marciocadev Mar 25, 2024
7bdfe51
Update libs/wingsdk/src/cloud/queue.ts
marciocadev Mar 27, 2024
c5d5a64
refactoring
marciocadev Mar 27, 2024
ddce5d5
Merge branch 'dlq' of marcio:marciocadev/wing into dlq
marciocadev Mar 27, 2024
a710ec0
Merge branch 'main' into dlq
monadabot Mar 27, 2024
8509ca3
chore: self mutation (build.diff)
monadabot Mar 27, 2024
76d505f
refactoring
marciocadev Mar 27, 2024
6bc4e23
Merge branch 'dlq' of marcio:marciocadev/wing into dlq
marciocadev Mar 27, 2024
91b8cc3
Merge branch 'winglang:main' into dlq
marciocadev Mar 29, 2024
5376f3c
adding dead-letter queue support for queues on sim
marciocadev Mar 30, 2024
66fbadf
Merge branch 'winglang:main' into dlq
marciocadev Mar 30, 2024
2052887
refactoring
marciocadev Mar 31, 2024
f316958
Merge branch 'winglang:main' into dlq
marciocadev Apr 2, 2024
e305af3
refactoring1
marciocadev Apr 2, 2024
ca44226
refactoring
marciocadev Apr 2, 2024
921d2cb
Merge branch 'winglang:main' into dlq
marciocadev Apr 4, 2024
129c196
fix maxDeliveryAttemps param in sim and refactoring the test
marciocadev Apr 5, 2024
e4b115a
refactoring
marciocadev Apr 5, 2024
22802a3
Update examples/tests/sdk_tests/queue/dead-letter-queue.test.w
marciocadev Apr 5, 2024
220f265
Merge branch 'main' into dlq
monadabot Apr 5, 2024
add5fb9
chore: self mutation (e2e-2of2.diff)
monadabot Apr 5, 2024
55bbb6d
chore: update test
marciocadev Apr 5, 2024
7b9e5e1
chore: update test
marciocadev Apr 5, 2024
608adff
chore: update test
marciocadev Apr 5, 2024
cb2fe72
Merge branch 'main' into dlq
monadabot Apr 5, 2024
b51c808
chore: self mutation (build.diff)
monadabot Apr 5, 2024
5507f98
chore: self mutation (e2e-1of2.diff)
monadabot Apr 5, 2024
8c98880
show the connection between the main queue and the dead-letter queue …
marciocadev Apr 5, 2024
cd5c427
refactoring
marciocadev Apr 5, 2024
20a71a6
Merge branch 'winglang:main' into dlq
marciocadev Apr 7, 2024
d8f487e
Merge branch 'main' into dlq
marciocadev Apr 9, 2024
a3be3f4
refactoring
marciocadev Apr 9, 2024
91a618b
Merge branch 'main' into dlq
monadabot Apr 9, 2024
43d3a40
chore: self mutation (e2e-1of2.diff)
monadabot Apr 9, 2024
7f5940b
Merge branch 'main' into dlq
marciocadev Apr 11, 2024
60e6bf9
refactoring
marciocadev Apr 11, 2024
a3afe10
Merge branch 'main' into dlq
monadabot Apr 11, 2024
01eefc5
chore: self mutation (e2e-2of2.diff)
monadabot Apr 11, 2024
159a384
Merge branch 'winglang:main' into dlq
marciocadev Apr 13, 2024
8ebad26
Merge branch 'main' into dlq
monadabot Apr 13, 2024
672127e
chore: self mutation (e2e-1of2.diff)
monadabot Apr 13, 2024
0690c20
refactoring
marciocadev Apr 13, 2024
0206df1
Merge branch 'dlq' of marcio:marciocadev/wing into dlq
marciocadev Apr 13, 2024
a2ca183
Merge branch 'main' into dlq
monadabot Apr 13, 2024
2faf567
chore: self mutation (e2e-1of2.diff)
monadabot Apr 13, 2024
d75e739
Merge branch 'winglang:main' into dlq
marciocadev Apr 16, 2024
ad369ee
Merge branch 'main' into dlq
marciocadev Apr 18, 2024
b7b8f7f
Merge branch 'main' into dlq
monadabot Apr 18, 2024
fed9955
chore: self mutation (build.diff)
monadabot Apr 18, 2024
1c52398
Update libs/wingsdk/src/target-sim/schema-resources.ts
marciocadev Apr 18, 2024
f847588
Update libs/wingsdk/src/cloud/queue.ts
marciocadev Apr 18, 2024
19df824
Update libs/wingsdk/src/cloud/queue.ts
marciocadev Apr 18, 2024
8f75e7c
refactoring
marciocadev Apr 18, 2024
e676063
refactoring
marciocadev Apr 18, 2024
39925ea
Merge branch 'main' into dlq
monadabot Apr 18, 2024
64f3089
chore: self mutation (build.diff)
monadabot Apr 18, 2024
38a7ba5
chore: self mutation (e2e-1of2.diff)
monadabot Apr 18, 2024
643f2ea
Merge branch 'winglang:main' into dlq
marciocadev Apr 20, 2024
26c15a4
adding a dead letter queue example to cloud/queue.md
marciocadev Apr 20, 2024
fd6506a
Merge branch 'main' into dlq
monadabot Apr 20, 2024
57fbaa2
chore: self mutation (build.diff)
monadabot Apr 20, 2024
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
60 changes: 60 additions & 0 deletions docs/docs/04-standard-library/cloud/queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,52 @@ The tree node.

## Structs <a name="Structs" id="Structs"></a>

### DeadLetterQueueProps <a name="DeadLetterQueueProps" id="@winglang/sdk.cloud.DeadLetterQueueProps"></a>

Dead letter queue options.

#### Initializer <a name="Initializer" id="@winglang/sdk.cloud.DeadLetterQueueProps.Initializer"></a>

```wing
bring cloud;

let DeadLetterQueueProps = cloud.DeadLetterQueueProps{ ... };
```

#### Properties <a name="Properties" id="Properties"></a>

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@winglang/sdk.cloud.DeadLetterQueueProps.property.queue">queue</a></code> | <code><a href="#@winglang/sdk.cloud.Queue">Queue</a></code> | Queue to receive messages that failed processing. |
| <code><a href="#@winglang/sdk.cloud.DeadLetterQueueProps.property.maxDeliveryAttemps">maxDeliveryAttemps</a></code> | <code>num</code> | Number of times a message will be processed before being sent to the dead-letter queue. |

---

##### `queue`<sup>Required</sup> <a name="queue" id="@winglang/sdk.cloud.DeadLetterQueueProps.property.queue"></a>

```wing
queue: Queue;
```

- *Type:* <a href="#@winglang/sdk.cloud.Queue">Queue</a>

Queue to receive messages that failed processing.

---

##### `maxDeliveryAttemps`<sup>Optional</sup> <a name="maxDeliveryAttemps" id="@winglang/sdk.cloud.DeadLetterQueueProps.property.maxDeliveryAttemps"></a>

```wing
maxDeliveryAttemps: num;
```

- *Type:* num
- *Default:* 1

Number of times a message will be processed before being sent to the dead-letter queue.

---

### QueueProps <a name="QueueProps" id="@winglang/sdk.cloud.QueueProps"></a>

Options for `Queue`.
Expand All @@ -286,11 +332,25 @@ let QueueProps = cloud.QueueProps{ ... };

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@winglang/sdk.cloud.QueueProps.property.dlq">dlq</a></code> | <code><a href="#@winglang/sdk.cloud.DeadLetterQueueProps">DeadLetterQueueProps</a></code> | A dead-letter queue. |
| <code><a href="#@winglang/sdk.cloud.QueueProps.property.retentionPeriod">retentionPeriod</a></code> | <code><a href="#@winglang/sdk.std.Duration">duration</a></code> | How long a queue retains a message. |
| <code><a href="#@winglang/sdk.cloud.QueueProps.property.timeout">timeout</a></code> | <code><a href="#@winglang/sdk.std.Duration">duration</a></code> | How long a queue's consumers have to process a message. |

---

##### `dlq`<sup>Optional</sup> <a name="dlq" id="@winglang/sdk.cloud.QueueProps.property.dlq"></a>

```wing
dlq: DeadLetterQueueProps;
```

- *Type:* <a href="#@winglang/sdk.cloud.DeadLetterQueueProps">DeadLetterQueueProps</a>
- *Default:* no dead letter queue

A dead-letter queue.

---

##### `retentionPeriod`<sup>Optional</sup> <a name="retentionPeriod" id="@winglang/sdk.cloud.QueueProps.property.retentionPeriod"></a>

```wing
Expand Down
14 changes: 14 additions & 0 deletions docs/docs/04-standard-library/cloud/topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,25 @@ let TopicSubscribeQueueOptions = cloud.TopicSubscribeQueueOptions{ ... };

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@winglang/sdk.cloud.TopicSubscribeQueueOptions.property.dlq">dlq</a></code> | <code><a href="#@winglang/sdk.cloud.DeadLetterQueueProps">DeadLetterQueueProps</a></code> | A dead-letter queue. |
| <code><a href="#@winglang/sdk.cloud.TopicSubscribeQueueOptions.property.retentionPeriod">retentionPeriod</a></code> | <code><a href="#@winglang/sdk.std.Duration">duration</a></code> | How long a queue retains a message. |
| <code><a href="#@winglang/sdk.cloud.TopicSubscribeQueueOptions.property.timeout">timeout</a></code> | <code><a href="#@winglang/sdk.std.Duration">duration</a></code> | How long a queue's consumers have to process a message. |

---

##### `dlq`<sup>Optional</sup> <a name="dlq" id="@winglang/sdk.cloud.TopicSubscribeQueueOptions.property.dlq"></a>

```wing
dlq: DeadLetterQueueProps;
```

- *Type:* <a href="#@winglang/sdk.cloud.DeadLetterQueueProps">DeadLetterQueueProps</a>
- *Default:* no dead letter queue

A dead-letter queue.

---

##### `retentionPeriod`<sup>Optional</sup> <a name="retentionPeriod" id="@winglang/sdk.cloud.TopicSubscribeQueueOptions.property.retentionPeriod"></a>

```wing
Expand Down
56 changes: 56 additions & 0 deletions examples/tests/sdk_tests/queue/dead-letter-queue.test.w
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
bring cloud;
bring util;

let c = new cloud.Counter();

let key_without_retries = "without_retries";
let dlq_without_retries = new cloud.Queue() as "dlq without retries";
let queue_without_retries = new cloud.Queue(
dlq: { queue: dlq_without_retries }
) as "queue without retries";
queue_without_retries.setConsumer(inflight (msg: str) => {
if msg == "fail" {
c.inc(1, key_without_retries);
throw "error";
}
});
marciocadev marked this conversation as resolved.
Show resolved Hide resolved

new std.Test(inflight () => {
queue_without_retries.push("Hello");
queue_without_retries.push("fail");
queue_without_retries.push("World!");

// wait until it executes once.
assert(util.waitUntil(inflight () => { return c.peek(key_without_retries) == 1; }));

// check if the "fail" message has arrived at the dead-letter queue
assert(util.waitUntil(inflight () => { return dlq_without_retries.pop() == "fail"; }));
}, timeout: 5m) as "one execution and send fail message to dead-letter queue";
marciocadev marked this conversation as resolved.
Show resolved Hide resolved


let key_with_retries = "with_retries";
let dlq_with_retries = new cloud.Queue() as "dlq with retries";
let queue_with_retries = new cloud.Queue(
dlq: {
queue: dlq_with_retries,
maxDeliveryAttemps: 2
}
) as "queue with retries";
queue_with_retries.setConsumer(inflight (msg: str) => {
if msg == "fail" {
c.inc(1, key_with_retries);
throw "error";
}
});

new std.Test(inflight () => {
queue_with_retries.push("Hello");
queue_with_retries.push("fail");
queue_with_retries.push("World!");

// wait until it executes once and retry one more times.
assert(util.waitUntil(inflight () => { return c.peek(key_with_retries) == 2; }));

// check if the "fail" message has arrived at the dead-letter queue
assert(util.waitUntil(inflight () => { return dlq_with_retries.pop() == "fail"; }));
}, timeout: 5m) as "one execution, two retries and send the fail message to dead-letter queue";
marciocadev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<html>
<head>
<script src="./wing.js"></script>
<title>Demo website</title>
</head>
<body>
<h1>Hello Wing!</h1>
<p id="par1"></p>
<p id="par2"></p>
<script src="./index.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
document.getElementById("par1").innerText = `apiUrl is: ${window.wingEnv?.apiUrl}`;
document.getElementById("par2").innerText = `anotherEnvVar is: ${window.wingEnv?.anotherEnvVar}`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is generated by wing
window.wingEnv = {};
2 changes: 2 additions & 0 deletions examples/tests/sdk_tests/website/react-website/public/wing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file is generated by wing
window.wingEnv = {};
20 changes: 17 additions & 3 deletions libs/awscdk/src/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { App } from "./app";
import { std, core, cloud } from "@winglang/sdk";
import { convertBetweenHandlers } from "@winglang/sdk/lib/shared/convert";
import { calculateQueuePermissions } from "@winglang/sdk/lib/shared-aws/permissions";
import { IAwsQueue } from "@winglang/sdk/lib/shared-aws/queue";
import { IAwsQueue, Queue as AwsQueue } from "@winglang/sdk/lib/shared-aws/queue";
import { addPolicyStatements, isAwsCdkFunction } from "./function";

/**
Expand All @@ -23,14 +23,27 @@ export class Queue extends cloud.Queue implements IAwsQueue {
super(scope, id, props);
this.timeout = props.timeout ?? std.Duration.fromSeconds(30);

this.queue = new SQSQueue(this, "Default", {
const queueOpt = props.dlq ? {
visibilityTimeout: props.timeout
? Duration.seconds(props.timeout?.seconds)
: Duration.seconds(30),
retentionPeriod: props.retentionPeriod
? Duration.seconds(props.retentionPeriod?.seconds)
: Duration.hours(1),
});
deadLetterQueue: {
queue: SQSQueue.fromQueueArn(this, "DeadLetterQueue", AwsQueue.from(props.dlq.queue)?.queueArn!),
maxReceiveCount: props.dlq.maxDeliveryAttemps ?? cloud.DEFAULT_DELIVERY_ATTEMPS,
}
} : {
visibilityTimeout: props.timeout
? Duration.seconds(props.timeout?.seconds)
: Duration.seconds(30),
retentionPeriod: props.retentionPeriod
? Duration.seconds(props.retentionPeriod?.seconds)
: Duration.hours(1),
}

this.queue = new SQSQueue(this, "Default", queueOpt);
}

public setConsumer(
Expand Down Expand Up @@ -63,6 +76,7 @@ export class Queue extends cloud.Queue implements IAwsQueue {

const eventSource = new SqsEventSource(this.queue, {
batchSize: props.batchSize ?? 1,
reportBatchItemFailures: true,
});

fn.awscdkFunction.addEventSource(eventSource);
Expand Down
3 changes: 3 additions & 0 deletions libs/awscdk/test/__snapshots__/queue.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ exports[`queue with a consumer function 2`] = `
"FunctionName": {
"Ref": "QueueSetConsumer06749388A",
},
"FunctionResponseTypes": [
"ReportBatchItemFailures",
],
},
"Type": "AWS::Lambda::EventSourceMapping",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ source: libs/wingc/src/lsp/completions.rs
kind: 7
documentation:
kind: markdown
value: "```wing\nclass Queue\n```\n---\nA queue.\n\n### Initializer\n- `...props` — `QueueProps?`\n \n - `retentionPeriod?` — `duration?` — How long a queue retains a message.\n - `timeout?` — `duration?` — How long a queue's consumers have to process a message.\n### Fields\n- `node` — `Node` — The tree node.\n### Methods\n- `approxSize` — `inflight (): num` — Retrieve the approximate number of messages in the queue.\n- `isConstruct` — `preflight (x: any): bool` — Checks if `x` is a construct.\n- `onLift` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this resource inflight.\n- `onLiftType` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.\n- `pop` — `inflight (): str?` — Pop a message from the queue.\n- `purge` — `inflight (): void` — Purge all of the messages in the queue.\n- `push` — `inflight (messages: Array<str>?): void` — Push one or more messages to the queue.\n- `setConsumer` — `preflight (handler: inflight (message: str): void, props: QueueSetConsumerOptions?): Function` — Create a function to consume messages from this queue.\n- `toString` — `preflight (): str` — Returns a string representation of this construct."
value: "```wing\nclass Queue\n```\n---\nA queue.\n\n### Initializer\n- `...props` — `QueueProps?`\n \n - `dlq?` — `DeadLetterQueueProps?` — A dead-letter queue.\n - `retentionPeriod?` — `duration?` — How long a queue retains a message.\n - `timeout?` — `duration?` — How long a queue's consumers have to process a message.\n### Fields\n- `node` — `Node` — The tree node.\n### Methods\n- `approxSize` — `inflight (): num` — Retrieve the approximate number of messages in the queue.\n- `isConstruct` — `preflight (x: any): bool` — Checks if `x` is a construct.\n- `onLift` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this resource inflight.\n- `onLiftType` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.\n- `pop` — `inflight (): str?` — Pop a message from the queue.\n- `purge` — `inflight (): void` — Purge all of the messages in the queue.\n- `push` — `inflight (messages: Array<str>?): void` — Push one or more messages to the queue.\n- `setConsumer` — `preflight (handler: inflight (message: str): void, props: QueueSetConsumerOptions?): Function` — Create a function to consume messages from this queue.\n- `toString` — `preflight (): str` — Returns a string representation of this construct."
sortText: gg|Queue
- label: Schedule
kind: 7
Expand Down Expand Up @@ -229,6 +229,12 @@ source: libs/wingc/src/lsp/completions.rs
kind: markdown
value: "```wing\nstruct CounterProps\n```\n---\nOptions for `Counter`.\n### Fields\n- `initial?` — `num?` — The initial value of the counter."
sortText: hh|CounterProps
- label: DeadLetterQueueProps
kind: 22
documentation:
kind: markdown
value: "```wing\nstruct DeadLetterQueueProps\n```\n---\nDead letter queue options.\n### Fields\n- `queue` — `Queue` — Queue to receive messages that failed processing.\n- `maxDeliveryAttemps?` — `num?` — Number of times a message will be processed before being sent to the dead-letter queue."
sortText: hh|DeadLetterQueueProps
- label: DomainProps
kind: 22
documentation:
Expand Down Expand Up @@ -269,7 +275,7 @@ source: libs/wingc/src/lsp/completions.rs
kind: 22
documentation:
kind: markdown
value: "```wing\nstruct QueueProps\n```\n---\nOptions for `Queue`.\n### Fields\n- `retentionPeriod?` — `duration?` — How long a queue retains a message.\n- `timeout?` — `duration?` — How long a queue's consumers have to process a message."
value: "```wing\nstruct QueueProps\n```\n---\nOptions for `Queue`.\n### Fields\n- `dlq?` — `DeadLetterQueueProps?` — A dead-letter queue.\n- `retentionPeriod?` — `duration?` — How long a queue retains a message.\n- `timeout?` — `duration?` — How long a queue's consumers have to process a message."
sortText: hh|QueueProps
- label: QueueSetConsumerOptions
kind: 22
Expand Down Expand Up @@ -323,7 +329,7 @@ source: libs/wingc/src/lsp/completions.rs
kind: 22
documentation:
kind: markdown
value: "```wing\nstruct TopicSubscribeQueueOptions extends QueueProps\n```\n---\nOptions for `Topic.subscribeQueue`.\n### Fields\n- `retentionPeriod?` — `duration?`\n- `timeout?` — `duration?`"
value: "```wing\nstruct TopicSubscribeQueueOptions extends QueueProps\n```\n---\nOptions for `Topic.subscribeQueue`.\n### Fields\n- `dlq?` — `DeadLetterQueueProps?`\n- `retentionPeriod?` — `duration?`\n- `timeout?` — `duration?`"
sortText: hh|TopicSubscribeQueueOptions
- label: WebsiteDomainOptions
kind: 22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ source: libs/wingc/src/lsp/completions.rs
kind: 7
documentation:
kind: markdown
value: "```wing\nclass Queue\n```\n---\nA queue.\n\n### Initializer\n- `...props` — `QueueProps?`\n \n - `retentionPeriod?` — `duration?` — How long a queue retains a message.\n - `timeout?` — `duration?` — How long a queue's consumers have to process a message.\n### Fields\n- `node` — `Node` — The tree node.\n### Methods\n- `approxSize` — `inflight (): num` — Retrieve the approximate number of messages in the queue.\n- `isConstruct` — `preflight (x: any): bool` — Checks if `x` is a construct.\n- `onLift` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this resource inflight.\n- `onLiftType` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.\n- `pop` — `inflight (): str?` — Pop a message from the queue.\n- `purge` — `inflight (): void` — Purge all of the messages in the queue.\n- `push` — `inflight (messages: Array<str>?): void` — Push one or more messages to the queue.\n- `setConsumer` — `preflight (handler: inflight (message: str): void, props: QueueSetConsumerOptions?): Function` — Create a function to consume messages from this queue.\n- `toString` — `preflight (): str` — Returns a string representation of this construct."
value: "```wing\nclass Queue\n```\n---\nA queue.\n\n### Initializer\n- `...props` — `QueueProps?`\n \n - `dlq?` — `DeadLetterQueueProps?` — A dead-letter queue.\n - `retentionPeriod?` — `duration?` — How long a queue retains a message.\n - `timeout?` — `duration?` — How long a queue's consumers have to process a message.\n### Fields\n- `node` — `Node` — The tree node.\n### Methods\n- `approxSize` — `inflight (): num` — Retrieve the approximate number of messages in the queue.\n- `isConstruct` — `preflight (x: any): bool` — Checks if `x` is a construct.\n- `onLift` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this resource inflight.\n- `onLiftType` — `preflight (host: IInflightHost, ops: Array<str>): void` — A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.\n- `pop` — `inflight (): str?` — Pop a message from the queue.\n- `purge` — `inflight (): void` — Purge all of the messages in the queue.\n- `push` — `inflight (messages: Array<str>?): void` — Push one or more messages to the queue.\n- `setConsumer` — `preflight (handler: inflight (message: str): void, props: QueueSetConsumerOptions?): Function` — Create a function to consume messages from this queue.\n- `toString` — `preflight (): str` — Returns a string representation of this construct."
sortText: gg|Queue
- label: Schedule
kind: 7
Expand Down Expand Up @@ -229,6 +229,12 @@ source: libs/wingc/src/lsp/completions.rs
kind: markdown
value: "```wing\nstruct CounterProps\n```\n---\nOptions for `Counter`.\n### Fields\n- `initial?` — `num?` — The initial value of the counter."
sortText: hh|CounterProps
- label: DeadLetterQueueProps
kind: 22
documentation:
kind: markdown
value: "```wing\nstruct DeadLetterQueueProps\n```\n---\nDead letter queue options.\n### Fields\n- `queue` — `Queue` — Queue to receive messages that failed processing.\n- `maxDeliveryAttemps?` — `num?` — Number of times a message will be processed before being sent to the dead-letter queue."
sortText: hh|DeadLetterQueueProps
- label: DomainProps
kind: 22
documentation:
Expand Down Expand Up @@ -269,7 +275,7 @@ source: libs/wingc/src/lsp/completions.rs
kind: 22
documentation:
kind: markdown
value: "```wing\nstruct QueueProps\n```\n---\nOptions for `Queue`.\n### Fields\n- `retentionPeriod?` — `duration?` — How long a queue retains a message.\n- `timeout?` — `duration?` — How long a queue's consumers have to process a message."
value: "```wing\nstruct QueueProps\n```\n---\nOptions for `Queue`.\n### Fields\n- `dlq?` — `DeadLetterQueueProps?` — A dead-letter queue.\n- `retentionPeriod?` — `duration?` — How long a queue retains a message.\n- `timeout?` — `duration?` — How long a queue's consumers have to process a message."
sortText: hh|QueueProps
- label: QueueSetConsumerOptions
kind: 22
Expand Down Expand Up @@ -323,7 +329,7 @@ source: libs/wingc/src/lsp/completions.rs
kind: 22
documentation:
kind: markdown
value: "```wing\nstruct TopicSubscribeQueueOptions extends QueueProps\n```\n---\nOptions for `Topic.subscribeQueue`.\n### Fields\n- `retentionPeriod?` — `duration?`\n- `timeout?` — `duration?`"
value: "```wing\nstruct TopicSubscribeQueueOptions extends QueueProps\n```\n---\nOptions for `Topic.subscribeQueue`.\n### Fields\n- `dlq?` — `DeadLetterQueueProps?`\n- `retentionPeriod?` — `duration?`\n- `timeout?` — `duration?`"
sortText: hh|TopicSubscribeQueueOptions
- label: WebsiteDomainOptions
kind: 22
Expand Down
Loading
Loading