Today, I just released the MessagePack-RPC for Java version 0.3.0!
The main change is, supporting the UDP protocol. The following is the example codes.
UDPClient
EventLoop loop = new EventLoop();
try {
Client c = new UDPClient("localhost", 19850, loop);
try {
Object o = c.call("intFunc1", 1);
int val = ((Number)c).intValue();
} finally {
c.close();
}
} finally {
loop.shutdown();
}
UDPServer
class ServerTest {
public int intFunc1(int a) { return a; }
public static void main(String[] args) {
Server s = new UDPServer("0.0.0.0", 19850, this);
s.serve();
}
}
Replacing “UDP” with “TCP” will work for the TCP Client/Server. Thanks to JBoss netty, it was really easy to support two different transports.
The next tasks are running the more serious stress test for the stability. And also, thrift-compatible IDL support is under development!
Looking forward to integrate into the real applications:-)
What about using message pack to communicate from a Java EE (JBoss in my case) server to rich clients? Have anybody worked on a Java EE connector for MessagePack-RPC?
/Trist
Hey kzk,
really nice work! Can’t wait to try it out and see the performance difference with thrift. I just had a small question. I understand the server is based on Netty and is thus purely async, but what about async clients? Do they use threads per connection under the hood or are they also purely async with a Selector like approach using nio?