EVENT API GUIDE
BFF SERVICE
The BFF service is a microservice that acts as a bridge between the client and backend services. It provides a unified API for the client to interact with multiple backend services, simplifying the communication process and improving performance.
Architectural Design Credit and Contact Information
The architectural design of this microservice is credited to.
For inquiries, feedback, or further information regarding the architecture, please direct your communication to:
Email:
We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.
Documentation Scope
Welcome to the official documentation for the BFF Service Event Listeners. This guide details the Kafka-based event listeners responsible for reacting to ElasticSearch index events. It describes listener responsibilities, the topics they subscribe to, and expected payloads.
Intended Audience
This documentation is intended for developers, architects, and system administrators involved in the design, implementation, and maintenance of the BFF Service. It assumes familiarity with microservices architecture, the Kafka messaging system, and ElasticSearch.
Overview
Each ElasticSearch index operation (create, update, delete) emits a corresponding event to Kafka. These events are consumed by listeners responsible for executing aggregate functions to ensure index- and system-level consistency.
Kafka Event Listeners
Kafka Event Listener: user-created
Event Topic: elastic-index-appaili_user-created
When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the AdminUserOverviewViewAggregateData function to enrich and store the final document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-updated
Event Topic: elastic-index-appaili_user-updated
When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the AdminUserOverviewViewAggregateData function to update the enriched document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-deleted
Event Topic: elastic-index-appaili>_user-deleted
When a user is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the AdminUserOverviewViewAggregateData function to handle removal or cleanup in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-created
Event Topic: elastic-index-subscription-created
When a subscription is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subscriptionReAdminUserOverviewView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-updated
Event Topic: elastic-index-appaili>_subscription-updated
When a subscription is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subscriptionReAdminUserOverviewView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-deleted
Event Topic: elastic-index-appaili>_subscription-deleted
When a subscription is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subscriptionReAdminUserOverviewView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: moderationrecord-created
Event Topic: elastic-index-moderationrecord-created
When a moderationrecord is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the moderationRecordsReAdminUserOverviewView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: moderationrecord-updated
Event Topic: elastic-index-appaili>_moderationrecord-updated
When a moderationrecord is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the moderationRecordsReAdminUserOverviewView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: moderationrecord-deleted
Event Topic: elastic-index-appaili>_moderationrecord-deleted
When a moderationrecord is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the moderationRecordsReAdminUserOverviewView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: userquota-created
Event Topic: elastic-index-userquota-created
When a userquota is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userQuotaReAdminUserOverviewView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: userquota-updated
Event Topic: elastic-index-appaili>_userquota-updated
When a userquota is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userQuotaReAdminUserOverviewView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: userquota-deleted
Event Topic: elastic-index-appaili>_userquota-deleted
When a userquota is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userQuotaReAdminUserOverviewView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: mealplan-created
Event Topic: elastic-index-appaili_mealplan-created
When a mealplan is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the MealPlanDetailViewAggregateData function to enrich and store the final document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: mealplan-updated
Event Topic: elastic-index-appaili_mealplan-updated
When a mealplan is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the MealPlanDetailViewAggregateData function to update the enriched document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: mealplan-deleted
Event Topic: elastic-index-appaili>_mealplan-deleted
When a mealplan is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the MealPlanDetailViewAggregateData function to handle removal or cleanup in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: planmeal-created
Event Topic: elastic-index-planmeal-created
When a planmeal is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the mealsReMealPlanDetailView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: planmeal-updated
Event Topic: elastic-index-appaili>_planmeal-updated
When a planmeal is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the mealsReMealPlanDetailView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: planmeal-deleted
Event Topic: elastic-index-appaili>_planmeal-deleted
When a planmeal is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the mealsReMealPlanDetailView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-created
Event Topic: elastic-index-user-created
When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReMealPlanDetailView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-updated
Event Topic: elastic-index-appaili>_user-updated
When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReMealPlanDetailView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-deleted
Event Topic: elastic-index-appaili>_user-deleted
When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReMealPlanDetailView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: moderationrecord-created
Event Topic: elastic-index-appaili_moderationrecord-created
When a moderationrecord is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the ModerationNotificationViewAggregateData function to enrich and store the final document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: moderationrecord-updated
Event Topic: elastic-index-appaili_moderationrecord-updated
When a moderationrecord is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the ModerationNotificationViewAggregateData function to update the enriched document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: moderationrecord-deleted
Event Topic: elastic-index-appaili>_moderationrecord-deleted
When a moderationrecord is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the ModerationNotificationViewAggregateData function to handle removal or cleanup in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-created
Event Topic: elastic-index-user-created
When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReModerationNotificationView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-updated
Event Topic: elastic-index-appaili>_user-updated
When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReModerationNotificationView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-deleted
Event Topic: elastic-index-appaili>_user-deleted
When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReModerationNotificationView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-created
Event Topic: elastic-index-appaili_subscription-created
When a subscription is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the SubscriptionNotificationViewAggregateData function to enrich and store the final document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-updated
Event Topic: elastic-index-appaili_subscription-updated
When a subscription is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the SubscriptionNotificationViewAggregateData function to update the enriched document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-deleted
Event Topic: elastic-index-appaili>_subscription-deleted
When a subscription is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the SubscriptionNotificationViewAggregateData function to handle removal or cleanup in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-created
Event Topic: elastic-index-user-created
When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReSubscriptionNotificationView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-updated
Event Topic: elastic-index-appaili>_user-updated
When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReSubscriptionNotificationView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-deleted
Event Topic: elastic-index-appaili>_user-deleted
When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReSubscriptionNotificationView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: trainingprogram-created
Event Topic: elastic-index-appaili_trainingprogram-created
When a trainingprogram is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the TrainingProgramDetailViewAggregateData function to enrich and store the final document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: trainingprogram-updated
Event Topic: elastic-index-appaili_trainingprogram-updated
When a trainingprogram is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the TrainingProgramDetailViewAggregateData function to update the enriched document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: trainingprogram-deleted
Event Topic: elastic-index-appaili>_trainingprogram-deleted
When a trainingprogram is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the TrainingProgramDetailViewAggregateData function to handle removal or cleanup in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: programexercise-created
Event Topic: elastic-index-programexercise-created
When a programexercise is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the exercisesReTrainingProgramDetailView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: programexercise-updated
Event Topic: elastic-index-appaili>_programexercise-updated
When a programexercise is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the exercisesReTrainingProgramDetailView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: programexercise-deleted
Event Topic: elastic-index-appaili>_programexercise-deleted
When a programexercise is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the exercisesReTrainingProgramDetailView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-created
Event Topic: elastic-index-user-created
When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReTrainingProgramDetailView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-updated
Event Topic: elastic-index-appaili>_user-updated
When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReTrainingProgramDetailView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-deleted
Event Topic: elastic-index-appaili>_user-deleted
When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userInfoReTrainingProgramDetailView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-created
Event Topic: elastic-index-appaili_user-created
When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the UserDashboardViewAggregateData function to enrich and store the final document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-updated
Event Topic: elastic-index-appaili_user-updated
When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the UserDashboardViewAggregateData function to update the enriched document in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: user-deleted
Event Topic: elastic-index-appaili>_user-deleted
When a user is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the UserDashboardViewAggregateData function to handle removal or cleanup in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-created
Event Topic: elastic-index-subscription-created
When a subscription is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subscriptionReUserDashboardView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-updated
Event Topic: elastic-index-appaili>_subscription-updated
When a subscription is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subscriptionReUserDashboardView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: subscription-deleted
Event Topic: elastic-index-appaili>_subscription-deleted
When a subscription is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subscriptionReUserDashboardView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: trainingprogram-created
Event Topic: elastic-index-trainingprogram-created
When a trainingprogram is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the trainingProgramReUserDashboardView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: trainingprogram-updated
Event Topic: elastic-index-appaili>_trainingprogram-updated
When a trainingprogram is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the trainingProgramReUserDashboardView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: trainingprogram-deleted
Event Topic: elastic-index-appaili>_trainingprogram-deleted
When a trainingprogram is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the trainingProgramReUserDashboardView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: mealplan-created
Event Topic: elastic-index-mealplan-created
When a mealplan is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the mealPlanReUserDashboardView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: mealplan-updated
Event Topic: elastic-index-appaili>_mealplan-updated
When a mealplan is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the mealPlanReUserDashboardView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: mealplan-deleted
Event Topic: elastic-index-appaili>_mealplan-deleted
When a mealplan is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the mealPlanReUserDashboardView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: userquota-created
Event Topic: elastic-index-userquota-created
When a userquota is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userQuotaReUserDashboardView function to update dependent documents in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: userquota-updated
Event Topic: elastic-index-appaili>_userquota-updated
When a userquota is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userQuotaReUserDashboardView function to re-enrich dependent data in the related index.
Expected Payload:
{
"id": "String"
}
Kafka Event Listener: userquota-deleted
Event Topic: elastic-index-appaili>_userquota-deleted
When a userquota is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the userQuotaReUserDashboardView function to handle dependent data cleanup or updates.
Expected Payload:
{
"id": "String"
}