Expose Queue Name Property on Queue Bindings #13229
axmav
started this conversation in
Feature Requests
Replies: 1 comment
-
|
Tracked internally via https://jira.cfdata.org/browse/MQ-923 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the solution
Problem Description
Currently, when working with Cloudflare Queues in Workers, queue names are only available via
batch.queuein the queue consumer handler. This creates a maintenance issue when queue names are dynamic (e.g., environment-specific likeemail-queue-staging,email-queue-pr-123) because developers must either:Current Problematic Code
Proposed Solution
Expose a
nameproperty on Queue bindings so developers can reference the actual configured queue name from the binding itself:Desired Usage
Benefits
Configuration Example
With this feature,
env.EMAIL_QUEUE.namewould return"email-queue-staging", making the consumer code environment-independent.Alternative Considered
Using pattern matching (current workaround), but this approach:
Use Cases
Beta Was this translation helpful? Give feedback.
All reactions