Skip to content

Conversation

tpetrucciani
Copy link
Collaborator

@tpetrucciani tpetrucciani commented Sep 26, 2025

⚠️ Ready for review, but cannot be merged now (pagopa/interop-be-monorepo#2470, pagopa/interop-be-monorepo#2446, pagopa/interop-be-monorepo#2354, pagopa/interop-be-monorepo#2474 should be merged first)

This PR adds the configuration to deploy on DEV all remaining services related to notifications

CATALOG_TOPIC: "event-store.dev_catalog.events"
DELEGATION_OUTBOUND_TOPIC: "outbound.dev_delegation.events"
DELEGATION_TOPIC: "event-store.dev_delegation.events"
EMAIL_SENDER_TOPIC: "dev_email-sender.emails"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New Kafka topic to be used for communication between the email-notification-dispatcher (that produces messages here when notifications are to be sent via email) and the email-sender (that consumes the message and actually sends the email via SES)

Should we do something to create the topic or is it automatically created on first connection?

TOPIC_STARTING_OFFSET: "latest"

deployment:
flywayInitContainer:
Copy link
Collaborator Author

@tpetrucciani tpetrucciani Sep 26, 2025

Choose a reason for hiding this comment

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

I set this to run migrations on the in-app notification DB, which are also run by the in-app-notification-manager

Base automatically changed from PIN-7770_deploy_in_app_notification_manager_to_dev to main September 30, 2025 08:19
@tpetrucciani tpetrucciani force-pushed the feat(dev)/PIN-7812_dev-configuration-for-notification-services branch 2 times, most recently from f3fed4c to 87c8cfa Compare September 30, 2025 12:47

configmap:
KAFKA_GROUP_ID: "{{.Values.namespace}}-email-notification-dispatcher"
TOPIC_STARTING_OFFSET: "latest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I set the dispatchers to latest to avoid sending notifications for pre-existing events


configmap:
KAFKA_GROUP_ID: "{{.Values.namespace}}-email-sender"
TOPIC_STARTING_OFFSET: "earliest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if it's useful to set to earliest, but this is a new topic so it's not an issue to reprocess older events

earliest could be better if email-sender starts processing after some messages have already been created by the dispatcher


configmap:
KAFKA_GROUP_ID: "{{.Values.namespace}}-notification-tenant-lifecycle-consumer"
TOPIC_STARTING_OFFSET: "latest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This consumer and notification-user-lifecycle-consumer are set to latest assuming that we'll use another process to import previous data (which is what we're assuming especially for the selfcare consumer)

@tpetrucciani
Copy link
Collaborator Author

@micdes-pagopa @borgesis95 Added a9f5820 to add two columns that were added to the readmodel in another PR but not here in the migrations

@tpetrucciani
Copy link
Collaborator Author

Added another migration in 9621c21 which is required by pagopa/interop-be-monorepo#2434

@tpetrucciani
Copy link
Collaborator Author

On second thought, merging this isn't useful until we understand the changes needed for Selfcare integration, which is deeply connected to how dispatchers work. I'll mark this as draft and open a separate PR for the minimal changes included here which it makes sense to merge now

@tpetrucciani tpetrucciani force-pushed the feat(dev)/PIN-7812_dev-configuration-for-notification-services branch from c291e1e to e6f1aea Compare October 14, 2025 15:43
metadata_version INTEGER NOT NULL,
user_id UUID NOT NULL,
tenant_id UUID NOT NULL,
user_roles VARCHAR[] NOT NULL,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As we decided in previous similar cases, I edited this migration rather than adding a new one (on the other hand, I left the "grant access to dispatchers" as a separate migration for consistency with other readmodel schema migrations)


configmap:
KAFKA_GROUP_ID: "{{.Values.namespace}}-notification-tenant-lifecycle-consumer"
TOPIC_STARTING_OFFSET: "earliest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is set to earliest so it creates default configurations for all existing tenants – event topics persist forever if I understood correctly from @galales, and the consumer handles both V1 and V2 events, so it should work.

Not sure whether it's useful to set to earliest already on DEV or if we want to do it just on QA/PROD. On DEV we might not need it (we can just create some configs manually), so if it's an issue to set to earliest (e.g. if it's resource-intensive for DEV to reprocess everything) we can set to latest here.


configmap:
KAFKA_GROUP_ID: "{{.Values.namespace}}-notification-user-lifecycle-consumer"
TOPIC_STARTING_OFFSET: "latest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is set to latest because the SC-Users topic has limited retention so we'll use another procedure to import past data

@tpetrucciani tpetrucciani marked this pull request as ready for review October 14, 2025 15:57
@tpetrucciani
Copy link
Collaborator Author

@micdes-pagopa I updated this PR and it's ready for review again (though it can't be merged and deployed until a few monorepo PRs, listed in the description, are merged)

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