I can't say whether it's the "recommended" way, but here's what my project
does:
- Since Dropwizard is based on Jetty, it seemed like a good idea to
stick with Jetty's websocket implementation.
- Include the Jetty websocket server on your server side (using the same
Jetty version as your Dropwizard package depends on):
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>9.4.2.v20170220</version>
</dependency>
- If you are using a Java client, include the Jetty websocket client:
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-client</artifactId>
<version>9.4.2.v20170220</version>
</dependency>
- Follow the Jetty websocket documentation
<https://www.eclipse.org/jetty/documentation/current/websocket-jetty.html>
to
implement.
- Implementing websockets was not trivial, so give yourself some time to
experiment and refactor.
I hope that helps,
Doug
On Tuesday, June 27, 2017 at 8:35:05 PM UTC-4, joshg wrote:
>
> What's the recommended way to use websockets with DropWizard?
> Everything I've tried either can't use websockets and falls back to long
> polling or throws an exception about not being able to find
> WebSocketServerFactory in the classpath.
>
--
You received this message because you are subscribed to the Google Groups
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.