-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Updates to event notifications docs #17035
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,6 @@ pcx_content_type: how-to | |
|
||
Event notifications send messages to your [queue](/queues/) when data in your R2 bucket changes. You can consume these messages with a [consumer Worker](/queues/reference/how-queues-works/#create-a-consumer-worker) or [pull over HTTP](/queues/configuration/pull-consumers/) from outside of Cloudflare Workers. | ||
|
||
:::note[Open Beta] | ||
|
||
The event notifications feature is currently in open beta. To report bugs or request features, go to the #r2-storage channel in the [Cloudflare Developer Discord](https://discord.cloudflare.com) or fill out the [feedback form](https://forms.gle/2HBKD9zG9PFiU4v79). | ||
|
||
::: | ||
|
||
## Get started with event notifications | ||
|
||
### Prerequisites | ||
|
@@ -21,13 +15,23 @@ Before getting started, you will need: | |
- An existing queue. If you do not already have a queue, refer to [Create a queue](/queues/get-started/#3-create-a-queue). | ||
- A [consumer Worker](/queues/reference/how-queues-works/#create-a-consumer-worker) or [HTTP pull](/queues/configuration/pull-consumers/) enabled on your Queue. | ||
|
||
### Set up Wrangler | ||
### Enable event notifications via Dashboard | ||
|
||
1. From the Cloudflare dashboard, select **R2** from the sidebar. | ||
2. Select the bucket you'd like to add an event notification rule to. | ||
3. Switch to the **Settings** tab, then scroll down to the **Event notifications** card. | ||
4. Select **Add notification** and choose the queue you'd like to receive notifications and the [type of event(s)](/r2/buckets/event-notifications/#event-types) that will trigger them. | ||
jonesphillip marked this conversation as resolved.
Show resolved
Hide resolved
|
||
5. Select **Add notification**. | ||
|
||
To begin, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/#install-wrangler) to install Wrangler, the Cloudflare Developer Platform CLI. Log into Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login). | ||
### Enable event notifications via Wrangler | ||
|
||
### Enable event notifications on your R2 bucket | ||
#### Set up Wrangler | ||
|
||
To enable event notifications, add an event notification rule to your bucket by running the [`r2 bucket notification create` command](/workers/wrangler/commands/#notification-create). Event notification rules determine the [event types](/r2/buckets/event-notifications/#event-types) that trigger notifications and enable filtering based on object `prefix` and `suffix`. | ||
To begin, install [`npm`](https://docs.npmjs.com/getting-started). Then [install Wrangler, the Developer Platform CLI](/workers/wrangler/install-and-update/). | ||
|
||
#### Enable event notifications on your R2 bucket | ||
|
||
Log in to Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login). Then add an [event notification rule](/r2/buckets/event-notifications/#event-notification-rules) to your bucket by running the [`r2 bucket notification create` command](/workers/wrangler/commands/#notification-create). | ||
|
||
```sh | ||
npx wrangler r2 bucket notification create <BUCKET_NAME> --event-type <EVENT_TYPE> --queue <QUEUE_NAME> | ||
|
@@ -48,6 +52,10 @@ $ npx wrangler r2 bucket notification create <BUCKET_NAME> --event-type <EVENT_T | |
|
||
For a more complete step-by-step example, refer to the [Log and store upload events in R2 with event notifications](/r2/examples/upload-logs-event-notifications/) example. | ||
|
||
## Event notification rules | ||
|
||
Event notification rules determine the [event types](/r2/buckets/event-notifications/#event-types) that trigger notifications and optionally enable filtering based on object `prefix` and `suffix`. You can have up to 100 event notification rules per R2 bucket. | ||
|
||
## Event types | ||
|
||
<table> | ||
|
@@ -81,18 +89,15 @@ For a more complete step-by-step example, refer to the [Log and store upload eve | |
<td> | ||
<code>object-delete</code> | ||
</td> | ||
<td> | ||
Triggered when an object is explicitly removed from the bucket. | ||
<br /> | ||
<br /> | ||
<b>Note</b>: During the beta, deletes that occur as a result of object | ||
lifecycle policies will not trigger this event. | ||
</td> | ||
<td>Triggered when an object is explicitly removed from the bucket.</td> | ||
<td> | ||
<ul> | ||
<li> | ||
<code>DeleteObject</code> | ||
</li> | ||
<li> | ||
<code>LifecycleDeletion</code> | ||
</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
|
@@ -224,12 +229,7 @@ Queue consumers receive notifications as [Messages](/queues/configuration/javasc | |
</tbody> | ||
</table> | ||
|
||
## Limitations | ||
|
||
During the beta, event notifications has the following limitations: | ||
## Notes | ||
|
||
- Queues [per-queue message throughput](/queues/platform/limits/) is currently 400 messages per second. If your workload produces more than 400 notifications per second, messages may be dropped. | ||
- For a given bucket, only one event notification rule can be created per queue. | ||
- Each bucket can have up to 5 event notification rules. | ||
- Deletes that occur as a result of object lifecycle policies will not trigger an event notification. | ||
- Event notifications are not available for buckets with [jursdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions). | ||
- Event notifications are not available for buckets with [jursdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions) (_coming soon_). | ||
- Queues [per-queue message throughput](/queues/platform/limits/) is currently 5,000 messages per second. If your workload produces more than 5,000 notifications per second, we recommend splitting notification rules across multiple queues. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something in the Queues docs that shows you how to do this, that we should link to? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about deleting this header and then making Prerequisites, and the two headers that follow, an H2 instead?