web-push-libs / webpush-java

Web Push library for Java
MIT License
315 stars 113 forks source link

PushAsyncService start an HTTP client but provides no way to shut it down, leaving threads running #198

Open gregopet opened 1 year ago

gregopet commented 1 year ago

When I create an instance of PushAsyncService, it automatically creates an AsyncHttpClient instance upon initialization. The client spawns some threads that prevent my whole application from shutting down (e.g. if a fatal configuration error was encountered).

If there was a close() or stop() method to call I would do so, but there is none and httpClient is private so I cannot access it (at least without resorting to reflection). If I "cheat" and call close() on the private httpClient, the app proceeds to shut down normally.