Skip to content

Conversation

pantierra
Copy link
Contributor

@pantierra pantierra commented Sep 11, 2025

Related to: EOEPCA/resource-discovery#167

  • This PR adds PostgreSQL notification triggers to the pgstac database that automatically send real-time notifications when STAC items are inserted, updated, or deleted. This enables event-driven applications to respond to catalog changes.
  • It includes eoapi-notifier middle-ware to listen on these notifications and redirect notification messages as cloudevents to knative (alternatively mqtt can also be used)

@pantierra pantierra marked this pull request as draft September 11, 2025 08:17
@pantierra pantierra force-pushed the feature/add-listen-notify branch 4 times, most recently from d7cdec5 to fc728e1 Compare September 11, 2025 09:54
@pantierra pantierra changed the title Add notification triggers in database. feat: Add notification triggers in database. Sep 11, 2025
@pantierra pantierra force-pushed the feature/add-listen-notify branch 2 times, most recently from ff14335 to 9c91ac8 Compare September 11, 2025 10:58
@pantierra pantierra force-pushed the feature/add-listen-notify branch 5 times, most recently from 7f0c7a2 to 68843e0 Compare September 15, 2025 12:16
@pantierra pantierra force-pushed the feature/add-listen-notify branch from 68843e0 to f32f782 Compare September 15, 2025 12:56
@pantierra pantierra changed the title feat: Add notification triggers in database. feat: Add pubsub notifications Sep 15, 2025
Copy link

@mneagul mneagul left a comment

Choose a reason for hiding this comment

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

Some of the changes recommended by me. The need for a KSVC is not clear.

Copy link

Choose a reason for hiding this comment

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

Why do you need a knative service ? Generation of events does not need knative-serving.

database: eoapi
username: eoapi
channel: pgstac_items_change
outputs:
Copy link

Choose a reason for hiding this comment

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

I would change this to something like:

    outputs:
      - type: cloudevents
        config:
          source: /eoapi/pgstac
          event_type: org.eoapi.stac.item
          destination:
             ref:
                 apiVersion: messaging.knative.dev/v1
                 kind: Broker
                 name: my-channel-1
                 namespace: serverless

Copy link

@mneagul mneagul Sep 15, 2025

Choose a reason for hiding this comment

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

The ideea is that when you create a SinkBinding in your helm chart it will result in a fully qualified URL to the Broker/Channel/Service, whatever else is referenced in the ref specification.

Also, besides ref I would also add url which should be mutually exclusive with ref. In case it is set it should be an URL to which you can POST the CloudEvent.

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