Search code examples
heroku

Is there any Heroku request queue for storing requests while dyno is down?


I am using Heroku for one of my hobby projects. I bumped into the following problem if webhook sends a request to Heroku and Java app restarts at this time, the request will be lost. Is there any native Heroku way or plugin that ensures that Heroku will get a request, at least once?

I didn't find anything so far, and the default solution is to take AWS Lambda or Google Cloud Function to ensure scalability and availability. I feel that it adds unnecessary complexity and possibly a maintenance headache.

To Summarize:

Is there any Heroku native mechanism or Heroku plugin that ensures that requests will be delivered?


Solution

  • Assuming your Java application restarts are related to dyno restarts or deploys:

    you might want to look into the preboot feature on Heroku.

    From their documentation:

    Preboot changes the standard dyno start behavior for web dynos. Instead of stopping the existing set of web dynos before starting the new ones, preboot ensures that the new web dynos are started (and receive traffic) before the existing ones are terminated. This can contribute to zero downtime deployments.