Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-3776

Create an outbox record table, entity, and a repository supporting CRUD operations.

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • Next - API
    • None
    • swatch-metrics-hbi
    • None

      In order to implement the outbox pattern in swatch-metrics-hbi, we need to add support for persisting the outbox records that will be produced while processing incoming HBI events.

      An outbox record should have the following schema:

      Column Name Type Description
      id UUID  A unique ID for the outbox record.
      org_id varchar The org_id for the associated event.
      created_on timestamp with timezone The timestamp at which this record was created.
      swatch_event_json JSONB The JSON string representation of an outgoing SWatch event adhering to our event schema.
      org_id_index index An index on org_id to facilitate look ups by org_id via the API

      Event Schema: https://github.com/RedHatInsights/rhsm-subscriptions/blob/main/swatch-model-events/schemas/event.yaml

      Required Testing

      • Only unit tests covering repository CRUD operations are required at this point.

      Acceptance Criteria

      • Liquibase change set is created that creates the new outbox table.
      • An outbox entity object is created.
      • A repository is created that supports CRUD persistence operations that will be used by the internal REST API.

              jcarvaja@redhat.com Jose Carvajal Hilario
              mstead@redhat.com Michael Stead
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: