-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
34 lines (19 loc) · 1.26 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
This project is an Event server designed to be deployed to a Google Compute Instance and handle
websocket connections.
You can run it directly in your IDE by creating a run configuration that uses the main class `io.vertx.core.Launcher`
and passes in the arguments `run com.universeprojects.eventserver.MainVerticle`.
The build.gradle uses the Gradle shadowJar plugin to assemble the application and all it's dependencies into a single "fat" jar.
To build the "fat jar"
./gradlew shadowJar
To run the fat jar:
java -jar build/libs/gradle-verticle-3.3.3-fat.jar
(You can take that jar and run it anywhere there is a Java 8+ JDK. It contains all the dependencies it needs so you
don't need to install Vert.x on the target machine).
Now point your browser at http://localhost:8080
Writing code in verticles allow you to scale it more easily, e.g. let's say you have 8 cores on your server and you
want to utilise them all, you can deploy 8 instances as follows:
java -jar build/libs/gradle-verticle-3.3.3-fat.jar -instances 8
You can also enable clustering and ha at the command line, e.g.
java -jar build/libs/gradle-verticle-3.3.3-fat.jar -cluster
java -jar build/libs/gradle-verticle-3.3.3-fat.jar -ha
Please see the docs for a full list of Vert.x command line options.