Using http
for internal services may not be the most efficient way to communicate. There are many protocols like thrift, zeromq and others that make communication over tcp
much faster.
This is a sample that shows the throughput of a single-threaded server.
- uses a freelance pattern
- uses ZeroMq 3.2.4 with java bindings
- uses Java 7
- get zeromq. no really, it may help.
- then build it:
$ brew install pkg-config
$ brew install automake
$ brew install autoconf
$ ./autogen.sh
$ ./configure
$ make
$ make install
- set the VM arguments to
-Djava.library.path=/usr/local/lib
- run the Server
- run the the jUnit test. Very elaborate, I know.
Note: the built zmq.jar
is already referenced in the lib.
Welcome any feedback