Skip to content

Event Queues#2608

Open
sjvans wants to merge 61 commits into
mainfrom
event-queues-reconciled
Open

Event Queues#2608
sjvans wants to merge 61 commits into
mainfrom
event-queues-reconciled

Conversation

@sjvans

@sjvans sjvans commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md
Comment thread guides/events/event-queues.md
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md
@sjvans

sjvans commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@renejeglinsky @smahati fyi: @dimamost to check for missing java content, then we can merge

Comment thread node.js/event-queues.md Outdated
Comment thread node.js/event-queues.md Outdated
Comment thread java/event-queues.md
Comment thread java/event-queues.md
Comment thread java/event-queues.md Outdated
Comment thread guides/events/event-queues.md
Comment thread guides/events/event-queues.md Outdated
Comment on lines +264 to +268
messaging:
services:
- name: messaging-name
inbox:
enabled: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inbox is disabled by default and must be explicitly enabled, as shown in the example. It may also be worth explaining that the inbox uses the default ordered outbox by default. This clarifies how inbound messages are processed and ensures that message handling semantics are understood.

In addition, users can override the default outbox by specifying a custom outbox via the cds.messaging.services..inbox.name configuration property.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add to java guide (maybe as part of "Default Outbox Services"?), preferably via follow-up.

Comment thread java/event-queues.md Outdated
Comment thread java/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
Comment thread guides/events/event-queues.md Outdated
@dimamost dimamost requested a review from renejeglinsky June 25, 2026 12:51
sjvans and others added 5 commits June 26, 2026 11:13
Co-authored-by: René Jeglinsky <rene.jeglinsky@sap.com>
Co-authored-by: Dietrich Mostowoj <34100436+dimamost@users.noreply.github.com>
Co-authored-by: Dietrich Mostowoj <34100436+dimamost@users.noreply.github.com>
Comment thread java/event-queues.md Outdated
sjvans and others added 3 commits June 26, 2026 12:12
Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>
@sjvans

sjvans commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@dimamost please address #2608 (comment) via follow-up

@renejeglinsky @smahati ready to merge from my side

@sjvans sjvans enabled auto-merge June 26, 2026 10:41
The two patterns complement each other: when the dispatch target *is* a message broker, the event queue is the transactional bridge that makes pub/sub safe across the local commit. The [Inbox](#inbox) does the mirror image on the receiving side.

> [!note] Related patterns
> [*Event Sourcing*](https://microservices.io/patterns/data/event-sourcing.html) solves the same atomic-state-change-and-publish problem by making an append-only event log the source of truth. Event queues persist messages only until processed and then delete them — they're a transactional bridge to remote systems, not the system of record.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stumbled here and gave it a try to rephrase

Suggested change
> [*Event Sourcing*](https://microservices.io/patterns/data/event-sourcing.html) solves the same atomic-state-change-and-publish problem by making an append-only event log the source of truth. Event queues persist messages only until processed and then delete them — they're a transactional bridge to remote systems, not the system of record.
> [*Event Sourcing*](https://microservices.io/patterns/data/event-sourcing.html) solves the same atomic-state-change-and-publish problem by establishing a source of truth through an append-only event log. Event queues persist messages only until processed and then delete them — they're a transactional bridge to remote systems, not the system of record.

Comment on lines +127 to +140
> [!tip] `await` is still needed
> Even though processing is asynchronous, you still need to `await` because the message is written to the database within the current transaction.

In Java, you can also wrap a service at runtime through the service catalog rather than wiring through Spring:

```java
OutboxService outbox = runtime.getServiceCatalog()
.getService(OutboxService.class, "XFlightsOutbox");
TravelService xflights = runtime.getServiceCatalog()
.getService(TravelService.class, "xflights");

xflights = outbox.outboxed(xflights);
xflights.bookingCreated(...);
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two things the only runtime-specific things in this section? Everything else is valid for Java and Node.js?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add the snippet to the code group above with the "header": Java w/o Spring
WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants