feat(queues): add persistent queue prototype - #190
Draft
sampolahtinen wants to merge 6 commits into
Draft
Conversation
Signed-off-by: Sampo Lahtinen <sampo.lahtinen@icloud.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
commit: |
Signed-off-by: Sampo Lahtinen <sampo.lahtinen@icloud.com>
Define the first version as many producers feeding one logical consumer per queue. Reserve publish-and-subscribe fan-out for a separate future capability. Signed-off-by: Sampo Lahtinen <sampo.lahtinen@icloud.com>
Signed-off-by: Sampo Lahtinen <sampo.lahtinen@icloud.com>
Keep direct external enqueue outside version one while recording the intended static, authenticated HTTPS extension and the in-graph gateway path. Signed-off-by: Sampo Lahtinen <sampo.lahtinen@icloud.com>
Remove outbound OpenTelemetry and product analytics from user-deployed queue services. Keep operational activity durable in queue_activity and available only through the wired operational port. Signed-off-by: Sampo Lahtinen <sampo.lahtinen@icloud.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduces the first persistent queue walking skeleton for Composer. It provides a typed queue definition and producer/consumer API, durable Postgres storage, and an independent Compute dispatcher that pushes work to application services.
Changes
defineQueues,queueProducer,queueConsumer,serveQueues,queues, andqueueDispatcherunder@prisma/composer-prisma-cloud/queues.FOR UPDATE SKIP LOCKED, and delivery is at least once.fixedBackoffconfiguration, persisted delayed retries, maximum-attempt enforcement, and terminal failed messages.examples/queues, where one Compute service hosts the UI, producer, and consumer while a separate dispatcher delivers messages. The fail-once control demonstrates a real failed first attempt and successful retry with the same message ID.Why
Queues remain a Prisma Cloud module composed from existing Postgres and Compute primitives instead of becoming a Composer core primitive. Keeping the durable queue service separate from the dispatcher avoids a dependency cycle, permits consumers to enqueue follow-up work, and lets delivery continue without producer traffic.
Prototype boundaries
This is intentionally a draft walking skeleton. Batches, several competing consumer services, exponential retry, replay, pause and resume, and operational APIs are not implemented yet.
The deployment prototype also exposed two Composer lifecycle issues documented in
.agents/diary/queues-prototype.md: artifact and binding updates can become active in the wrong order, and promoting a new continuously running Compute revision does not retire previous revisions. Only one dispatcher revision should run until deployment retirement or revision fencing is implemented.Verification
pnpm formatpnpm typecheck— 78 tasks passedpnpm lintpnpm lint:castspnpm lint:depspnpm check:publish-depspnpm --filter @internal/queues test— 10 tests passed, including real Postgres integration tests