Skip to content

Using Pushy in an application container

Jon Chambers edited this page Jun 14, 2018 · 6 revisions

If you're planning to use Pushy inside an application container (for example, Tomcat, Wildfly, or JBoss), there are some extra challenges you'll need to consider.

General issues

Pushy will work just fine in a container environment, but Netty (the networking framework on which Pushy is built) creates some ThreadLocal instances that won't be cleaned up properly when your application shuts down. Most application containers have features designed to mitigate this kind of issue, but leaks are still possible. Users should be aware of the issue if using Pushy in an application container. Please see #73 for additional discussion.

Practically speaking, the worst outcome that users will face is a set of warnings when shutting down your webapp.

Tomcat-specific issues

Versions of Pushy prior to v0.9.3 are affected by issue where Tomcat's own tcnative library conflicts with netty-tcnative. If your Tomcat installation includes tcnative (and not all do!), you'll need to use Jetty's ALPN implementation instead of netty-tcnative. Please see netty/netty-tcnative#136 for details. This was resolved upstream in netty/netty#5766.

If you're using Pushy v0.9.3 or newer, no action is required.

JBoss/Wildfly-specific issues

If you're using JBoss/Wildfly, you may need to take additional steps to avoid a classloader conflict that prevents alpn-api from being loaded as expected. This problem may manifest as an "unexpected protocol" exception when connecting to the APNs server. For details and a workaround, please see #300.

If you're using Pushy v0.13.0 or newer, no action is required because Pushy no longer depends on ALPN.