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

Clone this repo:
  1. e7046e5 [SCB-2881] support setting hibernate validation configuration (#4343) by Alex · 17 hours ago master
  2. 1ad8b4d prepare new snapshot version (#4349) by liubao68 · 18 hours ago
  3. 865e580 [SCB-2883]support trace id header in response (#4348) by liubao68 · 20 hours ago
  4. d26c15d [SCB-2882]add services discovery api and support global instance id bean (#4347) by liubao68 · 2 days ago
  5. 633e8e2 [SCB-2880]able to inherit trace in edge service from web (#4339) by liubao68 · 4 days ago

Java Chassis 中文 Maven Central License

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.

releases

Release TrainLatest VersionCompiled JDK VersionTested JDK VersionOpen APINotes
Java Chassis 33.1.1OpenJDK 17OpenJDK 173.0.xDepends on Spring Boot 3
Java Chassis 22.8.16OpenJDK 8OpenJDK 8, 11, 172.0.xDepends on Spring 5
Java Chassis 11.3.11OpenJDK 8OpenJDK 82.0.xEnd of Support

NOTICE: Since Open API 3.0.x is not compatible with 2.0.x, Java Chassis 2 and Java Chassis 1 can not work together with Java Chassis 3. All related consumers, providers and edge service need use Java Chassis 3 when upgrading.

NOTICE: Java Chassis 1 reached its end of support now after it's first release from 2018.

Quick Start

  • Define API
@RequestMapping(path = "/provider")
public interface ProviderService {
  @GetMapping("/sayHello")
  String sayHello(@RequestParam("name") String name);
}
  • Provider service
@RestSchema(schemaId = "ProviderController", schemaInterface = ProviderService.class)
public class ProviderController implements ProviderService {
  @Override
  public String sayHello(String name) {
    return "Hello " + name;
  }
}
  • Consumer service
@Configuration
public class ProviderServiceConfiguration {
  @Bean
  public ProviderService providerService() {
    return Invoker.createProxy("provider", "ProviderController", ProviderService.class);
  }
}

Invoke Provider service with RPC

@RestSchema(schemaId = "ConsumerController", schemaInterface = ConsumerService.class)
public class ConsumerController implements ConsumerService {
  private ProviderService providerService;

  @Autowired
  public void setProviderService(ProviderService providerService) {
    this.providerService = providerService;
  }

  @Override
  public String sayHello(String name) {
    return providerService.sayHello(name);
  }
}

Try out this example here .

Documentation

Project documentation is available on the ServiceComb Java Chassis Developer Guide.

Building

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 17.

  mvn clean install

The first build may take a longer than expected as Maven downloads all the dependencies.

Automated Testing

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

Contact

Bugs: issues

mailing list: subscribe dev

Contributing

See CONTRIBUTING for details on submitting patches and the contribution workflow.

License

Licensed under an Apache 2.0 license.