Purpose

The main purpose of this service is to provide REST endpoints for retrieve different client’s configs. At the beginning , this service has 1 endpoint to get promo-campaigns by campaignId.

Specification: /swagger-ui/index.html

Business logic

All models in endpoint responses retrieved from db_collection 'promo-campaigns' and stores at internal cache. Used caffeine cache. Also service listen updates from kafka-topic 'config-api-promo-campaign' and stores updates to cache (or deletes model from cache in case of tombstones from kafka)

CDN cache

Cache lifetime is set in application config file 'cache-control:max-age-seconds':

promo-campaigns: 10

After deploy

VM instance configuration recommendation

CPU: 1 core, RAM: 1 Gb, HDD: 5 Gb

Predefined metrics

tomcat.*: metrics show the state of tomcat thread pool.

http_server_requests_seconds.* : displays how the api is used. Tags: exception, method, outcome, status, uri

spring_kafka_listener_seconds.* : displays information on kafka connection and consumption. Tags: exception, name, result

OpenAPI specification

Service Endpoints

Endpoint to …​

GET /

Endpoint to

GET /

Test endpoints not allowed to prod env

UI to

*host*/

Health

Default Actuator endpoint with custom data that specify is caches was initial loaded.

Logging