Skip to content

Commit 05c444c

Browse files
fixup! Example AWS Lambda function, triggered by the Reactor, that publishes another message back to Ably
1 parent 6ee48ea commit 05c444c

File tree

1 file changed

+5
-11
lines changed
  • src/pages/docs/platform/integrations/webhooks

1 file changed

+5
-11
lines changed

src/pages/docs/platform/integrations/webhooks/lambda.mdx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ Lambda functions might run multiple times for the same Ably event. Design functi
113113

114114
You can configure retry behavior in your AWS Lambda console under the function's asynchronous invocation settings. See the [AWS Lambda documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-errors) for details on adjusting retry settings.
115115

116-
## Routing Messages with Integration Rules <a id="routing"/>
116+
## Routing messages with integration Rules <a id="routing"/>
117117

118118
When an Integration Rule triggers your Lambda function, it can process the incoming message and publish a response back to Ably. This enables message routing and transformation patterns across your channels.
119119

120-
### Lambda Function Setup
120+
### Lambda Function setup
121121

122-
Your Lambda function must be packaged with the Ably client library and uploaded to AWS Lambda as a zip file.
122+
Your Lambda Function must be packaged with the Ably SDK and uploaded to AWS Lambda as a zip file.
123123

124-
For a complete example package, see: https://github.com/ably/example-lambda-function
124+
Uses `Ably.Rest` instead of `Ably.Realtime` because REST API is more efficient for one-off publishing operations and avoids WebSocket connection overhead in Lambda's stateless environment.
125125

126-
### Implementation
126+
The following example shows an AWS Lambda function that receives Ably events and publishes responses back to an Ably channel:
127127

128128
<Code>
129129
```javascript
@@ -163,9 +163,3 @@ exports.handler = (event, context, callback) => {
163163
};
164164
```
165165
</Code>
166-
167-
### Important Considerations
168-
169-
**Avoiding Infinite Loops**: Never publish messages to a channel that would trigger the same Integration Rule. Always ensure your target channel is different from the source channel or configure your Integration Rule with appropriate channel filters.
170-
171-
**Using REST vs. Realtime**: The example uses `Ably.Rest` instead of `Ably.Realtime` because REST API is more efficient for one-off publishing operations and avoids WebSocket connection overhead in Lambda's stateless environment.

0 commit comments

Comments
 (0)