Skip to content

RHCLOUD-47238 Add Events and change notifications documentation#98

Open
josejulio wants to merge 2 commits into
project-kessel:mainfrom
josejulio:concepts-events
Open

RHCLOUD-47238 Add Events and change notifications documentation#98
josejulio wants to merge 2 commits into
project-kessel:mainfrom
josejulio:concepts-events

Conversation

@josejulio

Copy link
Copy Markdown
Contributor

Document Kessel's event system as CloudEvents 1.0 published to event topics. Explains what events are published (resource and relationship), event format, delivery guarantees (exactly-once, durability, ordering), and how events relate to the consistency model.

Written as pure Diataxis explanation focused on understanding the event system, not how to consume events (reserved for how-to guides).

All technical claims verified against source code (inventory-api proto definitions, outbox implementation).

Document Kessel's event system as CloudEvents 1.0 published to event topics.
Explains what events are published (resource and relationship), event format,
delivery guarantees (exactly-once, durability, ordering), and how events
relate to the consistency model.

Written as pure Diataxis explanation focused on understanding the event
system, not how to consume events (reserved for how-to guides).

All technical claims verified against source code (inventory-api proto
definitions, outbox implementation).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@josejulio josejulio changed the title Add comprehensive Events and change notifications concept documentation RHCLOUD-47238 Add comprehensive Events and change notifications concept documentation Jun 8, 2026
@josejulio josejulio changed the title RHCLOUD-47238 Add comprehensive Events and change notifications concept documentation RHCLOUD-47238 Add Events and change notifications concept documentation Jun 8, 2026
@josejulio josejulio changed the title RHCLOUD-47238 Add Events and change notifications concept documentation RHCLOUD-47238 Add Events and change notifications documentation Jun 8, 2026
@tylercreller

Copy link
Copy Markdown
Member

I think the agent(s) got confused here because our eventing has changed and the old patterns were not fully removed. Using the CloudEvents spec was an artifact of the old eventing system. I looked at the current inventory-api source and our outbox events don't actually use or conform to CloudEvents 1.0. There's no CloudEvents SDK in go.mod, the ResourceEvent struct in model_legacy/outboxevents.go just happens to have fields named after CloudEvents attributes, and the source field is permanently empty with a TODO that was never implemented. There's also an e2e test (kafkaconsumer_test.go) that validates against a schema described as "compatible with CloudEvents" which is likely what reinforced this, but that test is just validating the shape of our custom payload, not actual spec compliance. We're essentially just pushing a resource as the payload to the Kafka topic. I would say we should err on the side of not calling out CloudEvents.


Kessel guarantees reliable event delivery with the following semantics:

**Exactly-once per write operation** — Each `ReportResource` or `DeleteResource` operation produces events atomically (one resource event and one relationship event). If the write succeeds, both events are guaranteed to be published. If the write fails, no events are published.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are not technically exactly-once, we are at-least-once processing. The consumer uses manual offset commits with a modulo of 10 (commitModulo: 10 in options.go:36). If the consumer crashes between processing a message and committing, that message will be reprocessed. The AlreadyExists handling in CreateTuple (line 518) shows the system is designed to handle duplicates, which is an at-least-once pattern with idempotency.

Address review comments from PR project-kessel#98:
- Remove CloudEvents 1.0 compliance claims - events are inspired by CloudEvents but not spec-compliant
- Change delivery guarantee from exactly-once to at-least-once with idempotent processing guidance
- Remove internal tuple events section - not relevant for external consumers
- Simplify to focus only on resource events on outbox.event.kessel.resources topic
- Fix event type pattern to explicit redhat.inventory.resources.{resource_type}.{operation}
- Add partitioning mechanism details (resource ID as message key)
- Improve delete event explanation with envelope metadata context

Verified against inventory-api source code that tuple events are internal synchronization
signals containing version metadata, not meant for external consumption.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants