How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

How do I wait my program thread for something to happen in Spring Boot and then wake it up?

calendar_today June 22, 2026 person malaachi domain spring-boot

I am writing this backend software where I need to send Firebase notifications to the client (a tablet), and when I send the notification itself (wrapped in a method) I want my thread to wait 10 seconds for the tablet to reply then, if the time has passed without getting a response, he should normally resume its execution but, if tablet reply falls within 10 seconds, I want my thread to wake up. How do I implement this thing? In the project our team is developing, we’re using an approach with ThreadPoolTaskExecutor .

open_in_new Read original post