Page 1 of 1

--How-to use Vert.x

PostPosted: Thu Jan 24, 2013 6:33 pm
by Development@SIB


This article is outdated - please use our new system at

https://doc.sibvisions.com




The integration of JVx in a Vert.x environment is very easy because JVx has a ready-to-use connector. Firstly, you have to start a Vert.x server (HttpServer or NetServer). We provide a simple class that starts a server and automatically uses JVx:

Simply execute (use ; instead of : on windows):

Code: Select all
java -DConfiguration.basedir=/path/to/rad_parent -cp jvx.jar:jvxvertx.jar:<your_application.jar> com.sibvisions.vertx.NetSocketServer -cluster-host=<ip or hostname>

Set Configuration.basedir to the directory that contains your rad directory. This is important, otherwise JVx does not find your application(s). The rad directory structure is as usual.

In your client application, simple use NetSocketConnection if you are using NetSocketServer or JVx' standard HttpConnection if you're using HttpServer.

Example:

Code: Select all
NetSocketConnection con = new NetSocketConnection(<ip or hostname>);
         
MasterConnection macon = new MasterConnection(con);
macon.setApplicationName(<application>);
macon.setUserName(<username>);
macon.setPassword(<password>);
macon.open();

That's it.

Now your application works without application server like JBoss or Tomcat, but you're able to use all JVx features for your application.