The SimplePushSender makes use of com.ning.http.client.AsyncHttpClient, which creates a number of daemon threads to perform its duties.
The problem with our usage of this is that we are creating an instance of the AsyncHttpClient in our constructor. There is no clean up the threads create and for every call more threads will build up over time. Another issue with this is that the container may create multiple instance of the class as it sees fit.
A solution to this issue would be to put the creation of the AsyncHttpClient instance in a method annotated with @PostConstruct which will only be called once, and then also close the AsyncHttpClient in a method annotated with @PreDestroy
|