For the time being, the simplest ways to explore and experiment with MatsSocket all start with checking out the repository, and go from there.
There are quite a few integration tests which are run at build, both for the JS and Dart clients. These fire up a Jetty “dev&test server” with a set of test-specific MatsSocket and Mats endpoints, and then repeatedly perform actual MatsSocket connections to the server to test each feature.
Actually, the tests fires up two Jetty instances, on port 8080 and 8081, sharing a common in-mem ActiveMQ as Mats message broker and common in-mem H2 Database as MatsSocket session backing. This to both showcase and test that multiple MatsSocketServer instances works.
So, clone down the repository, and test and build it (you can do that in a container to be on the safer side):
./gradlew clean test build
After this works out, you could point your IDE to the Gradle project, and find the
-> debug this main class, and then go to http://localhost:8080 or
Here’s its JavaDoc text:
Run integration tests and explore-scripts
NOTE! You may change the JS and HTML files while running, hit Ctrl+9 (build) to move them to the build directory.
Here’s the localhost:8081 (8080 and 8081 are identical):
(Firefox seems to have some problems using import maps, even with a polyfill. These problems are not indicative of how this would execute “in prod”. Chrome doesn’t seem to have the same problem. Reload often magically fixes the issue, so there might be some async races laying here - help appreciated!)
Explore the Java and JS/HTML sides
You may now explore the Java setup, and JS/HTML. Any changes to the browser side can be reloaded right away (Ctrl+9 to rebuild and move the files into place), while if you set up new MatsSocket Endpoints or Mats Endpoints, you’ll have to restart the server to load them. Implementations of said endpoints can often be hot reloaded by e.g. IntelliJ.