Skip to content

feat(queue): add cloud-agnostic queue publisher abstraction#35628

Merged
swicken merged 10 commits into
mainfrom
feat/queue-provider
May 12, 2026
Merged

feat(queue): add cloud-agnostic queue publisher abstraction#35628
swicken merged 10 commits into
mainfrom
feat/queue-provider

Conversation

@swicken
Copy link
Copy Markdown
Member

@swicken swicken commented May 8, 2026

Summary

Closes #35630

  • Introduces a DotQueuePublisher interface with config-driven provider selection via DotQueuePublisherLocator (DOT_QUEUE_PROVIDER)
  • Ships with two implementations: SqsQueuePublisher (AWS SQS via IAM/default credentials chain) and NoOpQueuePublisher (default, discards messages)
  • Supports custom providers via fully-qualified class name in config, matching the existing DotPubSubProviderLocator extensibility pattern
  • Logical queue names map to provider-specific destinations through config (DOT_QUEUE_SQS_URL_<QUEUE_NAME>)

This is a standalone infrastructure abstraction with no consumers wired up yet. Analytics event delivery will be connected in a follow-up PR.

Configuration

Property Description Default
DOT_QUEUE_PROVIDER sqs, noop, or a fully-qualified class name noop
DOT_QUEUE_SQS_REGION AWS region us-east-1
DOT_QUEUE_SQS_ENDPOINT Custom endpoint (LocalStack/dev only) (omit for standard AWS)
DOT_QUEUE_SQS_URL_<NAME> Maps logical queue name to SQS queue URL (required per queue)

Test plan

  • 8 unit tests passing (locator selection, null validation, no-op behavior, missing queue URL)
  • NoOpQueuePublisher is default when no provider configured
  • Bad provider config fails fast with DotQueueException (no silent fallback)
  • Manual: verify SQS publish against LocalStack with DOT_QUEUE_PROVIDER=sqs

swicken added 6 commits May 8, 2026 14:19
Introduce a DotQueuePublisher interface with a config-driven locator
(DOT_QUEUE_PROVIDER) and two implementations: SqsQueuePublisher using
the default AWS credentials chain (IAM roles), and a NoOpQueuePublisher
for when no provider is configured. Designed to be extended with
additional cloud providers (GCP Pub/Sub, Azure Service Bus) as needed.
…er warning

- SqsQueuePublisher.publish() validates queueName and messageBody
- NoOpQueuePublisher constructor is now private (singleton via INSTANCE)
- DotQueuePublisherLocator warns on unrecognized provider values
Locator now accepts a fully-qualified class name in DOT_QUEUE_PROVIDER
for custom/plugin providers, matching the DotPubSubProviderLocator
extensibility pattern. isAvailable(queueName) validates that the
logical queue name resolves to a configured destination.
… lookup

Locator now throws DotQueueException instead of falling back to no-op
when an explicit custom provider class cannot be loaded — prevents
silent message loss from config typos. Queue name uppercasing uses
Locale.ROOT to avoid Turkish-I and similar locale-dependent bugs.
@github-actions

This comment was marked as outdated.

@github-actions github-actions Bot added the Area : Backend PR changes Java/Maven backend code label May 8, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 8, 2026

Claude finished @swicken's task in 1m 16s —— View job


Rollback Safety Analysis

  • Read docs/core/ROLLBACK_UNSAFE_CATEGORIES.md
  • Reviewed PR diff (10 files, +440/-0)
  • Evaluated against every unsafe category
  • Applied label

Verdict: ✅ Safe to roll back

The PR is purely additive infrastructure:

  • New package com.dotcms.queue (interface + locator + exception + 2 provider impls)
  • New Maven dependencies in bom/application/pom.xml and dotCMS/pom.xml
  • New unit tests
  • No existing code modified (other than pom dependency additions)

Category check:

  • C-1…C-4 (structural / ES mapping / JSON model / DROP): no DB or ES touched
  • H-1…H-7 (migrations, renames, PK changes, new field types, storage provider, NOT NULL): none apply — DotQueuePublisher is a message-queue abstraction, not a binary StoragePersistenceProvider (H-5)
  • M-1…M-4 (column type, push-publish XML, REST/GraphQL, OSGi): no API contract change; this is a brand-new interface with no callers wired up, so N-1 has no dependency on it

Per the PR description, no consumers are wired up — analytics event delivery comes in a follow-up. N-1 simply doesn't have these classes and doesn't query for them; rollback is a no-op.

Label applied: AI: Safe To Rollback
feat/queue-provider

Swap from com.amazonaws (SDK v1, EOL Dec 2025) to
software.amazon.awssdk (SDK v2) for the SQS publisher. Add v2 BOM
to dependency management. Also: isAvailable() is now a cheap config
check (no client construction), validation uses null/isEmpty instead
of UtilMethods.isSet to avoid rejecting legitimate payloads, and
test uses an explicit sentinel queue name.
…e filtering

Add interface javadoc for intended publish-vs-isAvailable pattern,
document that empty attribute values are filtered, note that
DOT_QUEUE_PROVIDER is a trusted-operator setting (arbitrary class
loading), and document Lazy failure-retry behavior.
… coverage

Extract resolve(String) from the Lazy lambda so provider selection
logic is directly testable without static state. Trim and default
empty/whitespace DOT_QUEUE_PROVIDER values. Soften isAvailable
contract to "configuration check, not connectivity check." Add tests
for reflection branches (bad class, wrong interface), null/empty/
whitespace provider handling, and case-insensitive matching.
Comment thread dotCMS/src/main/java/com/dotcms/queue/DotQueuePublisherLocator.java
Comment thread dotCMS/src/main/java/com/dotcms/queue/DotQueuePublisherLocator.java
@swicken swicken added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 5383840 May 12, 2026
98 of 121 checks passed
@swicken swicken deleted the feat/queue-provider branch May 12, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

feat(queue): add cloud-agnostic queue publisher abstraction

5 participants