I'm using pubsub with batching and I wan't to be able to drain the queue on any pontential messages before the instance shutdown.
Piece of cake I thougt, just call shutdown() in LifecycleManager.shutdown(), end of story. However I'm running my instances with
autoscaling and there seems to be no way to get a proper callback when the servlet container is shutting down.
- LifecycleManager listener only works with manual and basic instance classes // as per documentation
- ServletContextListener.contextDestroy is never invoked by appengine // as per documentation
- "_ah/stop" is never called on auto scaled instances // as per documentation
Surely there must be a way of getting notified when an instance is about to shut down?