Skip to content

[Data Contracts] Contract Events Integration #7245

@carlesarnal

Description

@carlesarnal

Parent Epic

Part of #6192

Priority

P3 (Low)

Phase

Phase 4 - Audit & Events

Blocked By

  • Contract Lifecycle Status Management
  • Promotion Workflow

Description

Integrate contract events with the existing event system and webhook infrastructure.

Requirements

  • Define contract event types in events package:

    Event Trigger
    ContractCreated Contract metadata first added to artifact
    ContractMetadataUpdated Contract metadata fields changed
    ContractStatusChanged Status transition (DRAFT->STABLE, etc.)
    ContractPromoted Promotion stage changed
    ContractDeleted Contract metadata removed from artifact
  • Event record definitions:

    public record ContractCreated(
        String groupId,
        String artifactId,
        ContractMetadata metadata,
        String createdBy,
        Instant createdOn
    ) implements RegistryEvent {}
    
    public record ContractMetadataUpdated(
        String groupId,
        String artifactId,
        ContractMetadata previousMetadata,
        ContractMetadata newMetadata,
        String updatedBy,
        Instant updatedOn
    ) implements RegistryEvent {}
  • Ensure events are published via CDI @Observes pattern

  • Add event types to webhook event type filter configuration

  • Document webhook payload format for contract events

Webhook Payload Example

{
  "type": "CONTRACT_STATUS_CHANGED",
  "timestamp": "2025-01-15T10:30:00Z",
  "data": {
    "groupId": "com.example",
    "artifactId": "order-events",
    "previousStatus": "DRAFT",
    "newStatus": "STABLE",
    "changedBy": "user@example.com",
    "comment": "Ready for production"
  }
}

Acceptance Criteria

  • All contract events are published
  • Webhooks can subscribe to contract events
  • Event payloads are documented in OpenAPI spec
  • Integration tests verify event publishing

Technical Notes

Events location: app/src/main/java/io/apicurio/registry/events/

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/lowLow priority issues that should only be worked on if they are easy to complete.type/enhancementIssues that represent requests for new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions