http://zijan.iteye.com/blog/2041894
The project was first (2008) a cache Server for a network game, and a Web session service for e-commerce. Later, adding new features, in addition to Java also supports C #, it is now possible to use it to develop web-game servers. Wait a few days I will also open source network game server source code.
About performance, then the efficiency of the corresponding request in the background is 10W per second, now I measured in my own notebook, only one client and server are on a physical machine (CPU:I7-3610QM; ram:8g; os:win7-64), corresponding to 12,000 requests per second.
Tatala-client-csharp has been uploaded, and also tested on notebooks, a C # client with a Java server on a single machine, responding to 22,000 requests per second. In addition to the example of performance testing, C # clients have an example of a chat room that demonstrates server push.
Tatala The biggest feature is simplicity, performance is the second consideration to be able to meet most applications on the line. Because performance can be boosted by increasing the number of machines, the simplicity of the code means that fewer people are hired to develop faster. The boss saves money, the programmer is easy is the most important.
Open Source Address:
Https://github.com/zijan/Tatala
The following is a brief introduction.
Overview
Tatala is an easy-to-use RPC middleware and cross-language cross-platform. It transforms the calling method into a byte array (including the called Class name, the target method name, the parameter sequence, and the return value), which enables the client and server to communicate with each other on the socket basis.
Currently, Tatala supports Java clients with server-side, and C # clients.
features
* Easy to use to quickly develop and build network components
* Cross-language cross-platform
* High Performance and distributed
* Transmission protocol for short and concise binary
* Supports both long and short socket connections
* Client and server-side multithreading
* Supports asynchronous requests
* For big Data support compression transmission
* Can be used for cross-language remote method call RPC, high-performance cache server, distributed messaging Service, multiplayer online game server, etc.
Quick Start
Download Tatala.jar is included in the classpath of your project.
Simplicity is the Tatala first consideration, so using it to build RPC makes developers feel as simple as calling a local common method. Don't worry about networking, threading these things.
Now for example, suppose we have a server-side service Testmanager interface and a Testmanagerimpl implementation class.
Testmanager.java
Java code
- Public interface Testmanager {
- Public String SayHello (int Id, string name);
- }
Testmanagerimpl.java
Java code
- Public class Testmanagerimpl implements testmanager{
- Public String SayHello (int Id, string name) {
- return "[" +id+"]" +"Hello" +name+"!";
- }
- }
We also need to set up a socket service class on the server to deploy our business logic, in this case the socket Service listener port is 10001.
Testserver.java
Java code
- Public class TestServer {
- public static void Main (String args[]) {
- int listenport = 10001;
- int poolsize = 10;
- Aiosocketserver Server = new Aiosocketserver (Listenport, poolsize);
- Server.start ();
- }
- }
Then the client's code looks like this:
Easyclient.java
Java code
- Public class Easyclient {
- private static transferobjectfactory transferobjectfactory;
- private static Testmanager manager;
- public static void Main (string[] args) {
- Transferobjectfactory = New Transferobjectfactory ("Test1", true);
- Transferobjectfactory.setimplclass ("Testmanagerimpl");
- Manager = (Testmanager) clientproxyfactory.create (Testmanager. class, Transferobjectfactory);
- int Id = 18;
- String name = "JIMT";
- String result = Manager.sayhello (Id, name);
- System.out.println ("Result:" +result);
- }
- }
Of course we need to add the interface class (Testmanager.class) to the client's classpath. The client also needs a configuration file controller.xml lists the IP, port, and connection name of the server-side program to be called by the client. (Note the connection name "Test1")
Controller.xml
XML code
- <connections>
- <connection>
- <hostip>127.0.0.1</hostip>
- <hostport>10001</hostport>
- <timeout>5000</timeout>
- <retrytime>3</retrytime>
- <name>test1</name>
- </Connection>
- </Connections>
This is all code and configuration for establishing a Tatala RPC.
For more examples, see the tutorial.
tatala-Chinese Course
Transport Protocol
When the client sets the calling method information to transfer object, Tatala converts the transfer object into a byte array and sends it to the server. The received byte array is then restored to the transfer object containing the invocation information on the server side. Includes called class name, target method name, parameter information and return type, and so on. The Tatala executor obtains the call information execution target method.
type of support
Tatala supported parameters and return types:
Bool,byte,short,chat,int,long,float,double,date,string,
Byte[],int[],long[],float[],double[],string[],serializable,wrapperclass
Other Description
JDK1.7 is required because Java AIO is used.
Third-party class libraries include xsteam,log4j.
License
Apache License Version 2.0
Share an easy-to-use RPC Open source project-tatala