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-clonesahibinden_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 AdminDashboardViewAggregateData 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-clonesahibinden_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 AdminDashboardViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-deleted

Event Topic: elastic-index-clonesahibinden>_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 AdminDashboardViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: listing-created

Event Topic: elastic-index-clonesahibinden_listing-created

When a listing is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the ListingListViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: listing-updated

Event Topic: elastic-index-clonesahibinden_listing-updated

When a listing is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the ListingListViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: listing-deleted

Event Topic: elastic-index-clonesahibinden>_listing-deleted

When a listing is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the ListingListViewAggregateData 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 ownerUserReListingListView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-updated

Event Topic: elastic-index-clonesahibinden>_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 ownerUserReListingListView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-deleted

Event Topic: elastic-index-clonesahibinden>_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 ownerUserReListingListView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: category-created

Event Topic: elastic-index-category-created

When a category is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the categoryReListingListView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: category-updated

Event Topic: elastic-index-clonesahibinden>_category-updated

When a category is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the categoryReListingListView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: category-deleted

Event Topic: elastic-index-clonesahibinden>_category-deleted

When a category is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the categoryReListingListView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: category-created

Event Topic: elastic-index-category-created

When a category is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subcategoryReListingListView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: category-updated

Event Topic: elastic-index-clonesahibinden>_category-updated

When a category is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subcategoryReListingListView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: category-deleted

Event Topic: elastic-index-clonesahibinden>_category-deleted

When a category is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the subcategoryReListingListView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: location-created

Event Topic: elastic-index-location-created

When a location is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the locationReListingListView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: location-updated

Event Topic: elastic-index-clonesahibinden>_location-updated

When a location is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the locationReListingListView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: location-deleted

Event Topic: elastic-index-clonesahibinden>_location-deleted

When a location is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the locationReListingListView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: listingimage-created

Event Topic: elastic-index-listingimage-created

When a listingimage is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the coverImageReListingListView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: listingimage-updated

Event Topic: elastic-index-clonesahibinden>_listingimage-updated

When a listingimage is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the coverImageReListingListView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: listingimage-deleted

Event Topic: elastic-index-clonesahibinden>_listingimage-deleted

When a listingimage is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the coverImageReListingListView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}