On 10/7/19 11:21 AM, Bill Ross wrote: > Why not have a ContextHandler that starts a setup thread on init, and > answers 503 until that thread is done?
That's sort of what I currently do (starting a setup thread from the main servlet's init method) but that causes all kinds of trouble because the servlet context accepts requests before all the app logic is ready. Based on your suggestion combined with Greg's before I came up with this approach: Register a ContextHandler that answers 503 and let the server start normally. After the server is started I launch the setup thread where I register the real app context with the server and manually send it a start(). After the context is started I unregister the ContextHandler that answers 503. The code is here: https://github.com/dirk-olmes/jetty-delayed-context-startup/tree/deferred_context_startup Ok, this approach works. But I was hoping that Jetty supported something like that out of the box. -dirk _______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users
