Share data with multiple spring application -
i have 1 main spring boot application , 2 dependent spring boot applications. dependent app load data(settings, , on) main app on start. external service may change data in main app , dependent app should reload data. there library or framework.
there 3 solutions:
- always retrieve data every requests. don't think case since have loaded them on beginning avoid solution.
- refresh initial data after amount of time (cron job).
- main application acts micro-service orchestrators , inform dependant application cache may invalid. every dependant application answer request refreshing cache.
for solution number 2 take @ spring boot @scheduled annotation. example can refresh data every 5 minutes @scheduled(fixedrate = 300000).
Comments
Post a Comment