The project was really launched in May, nineteen nineteen. The author was lazy and lazy, so he stopped for at least half a year. Recently, he started to pick it up again, rolled up his sleeves and continued to work, and finally lifted it out these days.

The project name is xmutca-rpc

Project Address:Github.com/pwh19920920…

Xmutca-rpc is a distributed service framework based on Netty development, providing stable and high performance RPC remote service call function, support registry, service governance, load balancing and other features, out of the box.

Module is introduced

  • 1. Xmutca-rpc-core Indicates the RPC core module
  • 2. Xmutca xml-rpc example RPC example
  • 3. Xmutca-rpc-local local container implementation
  • 4. Xmutca-rpc-registrie-nacos NacOS registry
  • 5. Xmutca-rpc-spring Spring container implementation

Realize the function

  • 1. Core implementation: SPI extension, support dynamic loading extension implementation, specific can see the implementation class ExtensionLoader
  • 2. Load balancing: rotation load, random load, can also be customized
  • 3. Cluster fault tolerance: FailFast Fast failure, FailOver FailOver, FailSafe FailSafe, FailBack recovery, Broadcast call
  • 4. Register discovery: Access to NACOS is currently supported
  • 5. Container support: Support local Java container, support spring container
  • Annotation extension: support annotation loading provider, annotation get remote RPC object
  • 7. Sequence mode: Support fastJson, Kryo, Protostuff serialization, default go protostuff serialization
  • 8. Fast expansion: allows loading custom filters, custom containers, custom registries, and more.

Quick start

1. Maven configuration <dependency> <groupId>com.xmutca</groupId> <artifactId>xmutca-rpc-core</artifactId> <version>0.0.1-SNAPSHOT </version> </dependency> <dependency> <groupId>com.xmutca</groupId> <artifactId>xmutca-rpc-spring</artifactId> <version>0.0.1-SNAPSHOT </version> </dependency> <dependency> <groupId>com.xmutca</groupId> < artifactId > xmutca xml-rpc registry - nacos < / artifactId > < version > 0.0.1 - the SNAPSHOT < / version > < / dependency > 2. Public Interface HelloService {/** *test
     * @param msg
     * @return*/ String sayHello(String msg); } @Component@provider (interfaceClass = HelloService.class) public class HelloServiceImpl implements HelloService { @Autowired private TestServicetestService;

    @Override
    public String sayHello(String msg) {
        return testService.test() + "- >"+ msg; The provider configures RPC: registry: nacos://localhost:8848Registry address
  provider: # provider configuration
    corePoolSize: 60       Number of core threads
    maxPoolSize: 300       # Maximum number of threads
    port: 8886             # provider port
    scanPackage: com.xmutca.rpc.provider.facade   Scan the provider package path
    metadata:              # Service metadata
      group: "order"       # Service Grouping
      serviceName: "test"  # service name
      version: "v1.0.0"    # Service Version5. Start the provider @ EnableXmutcaRpc @ SpringBootApplication public class XmutcaSpringProviderApplication {public static void main(String[] args) { SpringApplication.run(XmutcaSpringProviderApplication.class, args); @restController@requestMapping Public Class ControllerTest {@Reference(serviceName ="test", group = "order", interfaceClass = HelloService.class)
    private HelloService helloService;

    @RequestMapping("/test")
    public Object test() {
        return helloService.sayHello("test"); }} 7. Configure RPC: registry: nacos://localhost:8848 consumer: -timeout: 1000# timeout configuration
      metadata:
        group: "order"            # Service Grouping
        serviceName: "test"       # service name
        version: "v1.0.0"         # Service Version8. Start the consumer @ EnableXmutcaRpc @ SpringBootApplication public class XmutcaSpringConsumerApplication {public static void main(String[] args) { SpringApplication.run(XmutcaSpringConsumerApplication.class, args); }}Copy the code

The author digress

This project welcomes all gay friends to try, learn from each other, timely feedback, thank you.