简体   繁体   中英

Spring Boot applications, using a value/state between 2 services

I have 2 Spring Boot applications let's say named Application1 and Application2 . I have a state/mode/status whatever you call it in Application2 , whose value should be ON when Application1 runs a scheduler and will be OFF when it's stopped. This status value should be singleton in Application2 .

How can Application1 change the status value(Singleton) in Application2 .

Please help me How can I implement it in Spring Boot ?

Implement a rest service say getStatus() in Applicaton1 which will be providing the status of the scheduler (ON or OFF Status). getStatus() can be called from Application2 using RestTemplate .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM