Apache ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features
Provider service:
import org.apache.servicecomb.*;
@RpcSchema(schemaId = "helloworld")
public class HelloWorldProvider implements HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
Consumer service:
import org.apache.servicecomb.*;
@Component
public class HelloWorldConsumer {
@RpcReference(microserviceName = "pojo", schemaId = "helloworld")
private static HelloWorld helloWorld;
public static void main(String[] args) {
helloWorld.sayHello("Tank");
}
}
Project documentation is available on the ServiceComb website.
You don’t need to build from source to use Java Chassis (binaries in apache nexus ), but if you want to try out the latest and greatest, Java Chassis can be easily built with the maven. You also need JDK 1.8.
mvn clean install
If you want to build the release kits from the source
mvn clean install -Prelease,distribution
The first build may take a longer than expected as Maven downloads all the dependencies.
To build the docker image and run the integration tests with docker, you can use maven docker profile
mvn clean install -Pdocker -Pit
If you are using docker machine, please use the following command
mvn clean install -Pdocker -Pit -Pdocker-machine
Bugs: issues
See CONTRIBUTING for details on submitting patches and the contribution workflow.