A rack server with built upon Vertx
A vertx module that run rack applications.
Please checkout the wiki page before you proceed.
Add the following snippet to $VERTX\_HOME/conf/langs.properties
rackup=isaiah~mod-rack~0.1.1:org.jruby.jubilee.JubileeVerticleFactory
.ru=rackup
Make sure JRUBY_HOME is correctly set, and rack
gem is install before proceed.
Then run the rackup file as a normal verticle,
vertx run config.ru
Checkout the source and run the following command in the root directory of the project:
mvn install
Event Bus is a pub/sub mechanism, it can be used from server to server, server to client and client to client, with the same API! You can use it to build living real time web application.
Assume necessary javascript files are loaded in the page (they can be found here), run rack application with the following config:
$ cat config.json
{ "host": "0.0.0.0",
"port": 8080,
"event_bus": "/eventbus"
}
$ vertx run config.ru -conf config.json
In one browser:
var eb = new vertx.EventBus("/eventbus");
eb.registerHandler("test", function(data){
console.info(data);
});
In another:
var eb = new vertx.EventBus("/eventbus");
eb.send("test", "hello, world");
In the previous tab it should print the greetings you just sent.
For more advanced examples, please checkout the chatapp.
If you're creating a lot of connections to a Jubilee(Vert.x) server in a short period of time, e.g. benchmarking with tools like wrk, you may need to tweak some settings in order to avoid the TCP accept queue getting full. This can result in connections being refused or packets being dropped during the handshake which can then cause the client to retry.
A classic symptom of this is if you see long connection times just over 3000ms at your client.
How to tune this is operating system specific but in Linux you need to increase a couple of settings in the TCP / Net config (10000 is an arbitrarily large number)
sudo sysctl -w net.core.somaxconn=10000
sudo sysctl -w net.ipv4.tcp_max_syn_backlog=10000
For other operating systems, please consult your operating system documentation.
All kinds of contributions are welcome.
File an issue here if you encounter any problems. Or if you prefer to fix by yourself:
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)See LICENSE.txt
YourKit is kindly supporting Jubilee Server with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: YourKit Java Profiler and YourKit .NET Profiler.