Solon It's a miniature Java RPC Development framework . The project from 2018 Since its inception in , Referring to a lot of previous works ; For two years ,3500 A lot of commit; Kernel retention 0.1m The figure of , Super high running points , Good use experience . Support :Rpc、Rest api、Mvc Multiple development models .

Solon emphasize : restraint + concise + The principle of openness ; Strive for : smaller 、 faster 、 A freer experience .

Smaller :

kernel 0.1m, The smallest development unit 0.2m( comparison Dubbo、Springboot Project package , Small enough to be ignored )

Faster :

This machine helloworld test ,Qps Can be up to 12 Wan Zhi Du . May refer to :《helloworld_wrk_test

More freedom :( Code controls freedom )

//  In addition to the injection mode , You can also do it manually on demand 
//
// Get configuration manually
Map<String,String> db = Solon.cfg().getMap("db"); // Get the... In the container manually Bean
UserService userService = Aop.get(UserService.class); // Manual monitoring http post request
Solon.global().post("/user/update", x-> userService.updateById(x.paramMap())); // Manually add RPC service
Solon.global().add("/rpc/", HelloService.class, true);

Major changes in this edition :

1、 Release Solon cloud Adaptation interface and configuration specification

The design purpose of this specification : It provides a unified interface and configuration specification for the third-party micro service component adaptation . So as to make the adaptation and use of third-party micro service components more standardized and unified ; At the same time, developers can seamlessly switch between different third-party components .

The released interface and configuration specifications mainly include :

  • Configure service related interfaces and configurations
  • Register interfaces and configurations related to discovery services
  • Interface and configuration related to event bus
  • Log bus related interface and configuration

2、 Publish configuration service adaptation components

Components explain remarks
consul-solon-plugin Yes consul The adaptation of Use the first level directory as the corresponding configuration group
nacos-solon-plugin Yes nacos The adaptation of
water-solon-plugin Yes water The adaptation of

Description of characteristics :

  • 1- Support configuration loading at startup
solon.app:
group: demo # Application Group // It is also the default group used by the configuration service
name: helloapp # Application name // The application name used by the discovery service solon.cloud.consul: #consul, Can be replaced by nacos or water
server: 127.0.0.1 #consul Service address
config:
loadKey: "test.properties" # Configuration loaded at startup , And keep real-time updates ***( It's going to be Solon.cfg() Part of )
//
// Use the loaded test.properties In the configuration of the
//
@Configuration
public class DemoConfig {
@Bean
public DataSource ds(@Inject("${db1}") HikariDataSource ds){
return ds;
}
}
  • 2- Payment configuration subscription
/**
* Configure subscription ( Gets the real-time refresh of the configuration )
*/
@CloudConfig("demo_cache_header")
public class DemotConfigHandler implements CloudConfigHandler { @Override
public void handler(Config config) {
System.out.println(config.value());
}
}
  • 3- Support direct injection of cloud configuration , And automatic refresh mechanism ( Non singleton does not need to turn on the automatic refresh mechanism )
@Controller
public class DemoController {
@CloudConfig(value = "demo_header", autoRefreshed = true)
String demo_header;
}

Attached demo source code :https://gitee.com/noear/solon_rpc_demo/tree/main/demo21.solon-cloud-consul

3、 Publish the registration and discovery service adaptation component

Components explain
consul-solon-plugin Yes consul The adaptation of
nacos-solon-plugin Yes nacos The adaptation of
water-solon-plugin Yes water The adaptation of

Application example :

  • 1-Solon rpc Service registration
solon.app:
group: demo
name: helloapi # The application name used by the discovery service ( stay Demo, Will be NimaClient quote ) solon.cloud.consul:
server: 127.0.0.1 #consul Service address
@Mapping("/rpc/")
@Component(remoting = true)
public class HelloServiceImp implements HelloService {
@Override
public String hello() {
return "remote: hello";
}
}
  • 2-Solon rpc Service release
solon.app:
group: demo
name: helloapp solon.cloud.consul:
server: 127.0.0.1
@Controller
public class DemoController {
//
// "helloapi" Corresponding registered services
//
@NamiClient(name = "helloapi")
HelloService helloService; @Mapping("/test")
public String home(String msg) throws Exception {
return helloService.hello();
}
}

Attached demo source code :https://gitee.com/noear/solon_rpc_demo/tree/main/demo21.solon-cloud-consul

4、 Publish event bus service adaptation components

Components explain remarks
rabbitmq-solon-plugin Yes rabbitmq Adaptation of message queue
rocketmq-solon-plugin Yes rocketmq Adaptation of message queue Timed events cannot exceed 2 Hours
water-solon-plugin Yes water The adaptation of message center

Description of characteristics :

  1. Supports timed events
  2. Just subscribe to the topic , Every consumer group can receive
  3. If the current processing fails, it will be delayed and retried step by step , Until it's finally successful ; But it doesn't affect other consumer groups

The consumer group consists of solon.app.group + solon.app.name Automatically combined ; Or through solon.cloud.{ Components }.event.queue Appoint

Application example :

solon.app:
group: demo # Configure the default group used by the service
name: helloconsumer # The application name used by the discovery service solon.cloud.rocketmq:
server: localhost:5672 #rabbitmq Service address
username: root #rabbitmq Linked account
password: 123456 #rabbitmq Link password
//
// consumer : Subscription events
//
@CloudEvent("hello.demo")
public class EVENT_hello_demo implements CloudEventHandler {
@Override
public boolean handler(Event event) throws Throwable {
// Business processing
System.out.println(LocalDateTime.now() + ONode.stringify(event)); // If successful return true, Otherwise false( And then it'll be delayed )
return true;
}
} //
// The producer : Release events
//
@Controller
public class DemoController {
@Mapping("/test")
public Object test(String msg) {
if(Utils.isEmpty(msg)){
msg = "demo2";
} // Release events
Event event = new Event("hello.demo", msg);
return CloudClient.event().publish(event);
}
}

Attached demo source code :https://gitee.com/noear/solon_rpc_demo/tree/main/demo30.solon-cloud-rabbitmq

5、 Publish the log bus service adaptation component

  • water-solon-plugin( Yes water Log adaptation )

Description of characteristics :

  1. Support meta information description ( It can be operated semantically )
@Controller
public class DemoController { CloudLogger logger = CloudLogger.get(TestController.class); @Mapping("/test")
public void test(String msg) throws Exception {
logger.info(" I am a good person. :(");
logger.info(" I'm not :{} \n\n {}", " The bad guys ",12);
logger.info(Tags.tag2(" Clock in "), " Who am I ?");
}
}

6、NamiClient upgrade , And Solon cloud Standardize and better cooperate

new property explain Example
url complete url Address http://api.water.org/cfg/get/
group Service group water
name Service name or load balancing component name ( Use with discovery service ) waterapi
path route /cfg/get/

notes : Old expression based properties uri, No longer use

attach 1: Unified service adaptation interface

Service interface explain Adapter components are supported
CloudConfigService Configure service interface consul-solon-plugin、nacos-solon-plugin、water-solon-plugin
CloudDiscoveryService Discover service interfaces consul-solon-plugin、nacos-solon-plugin、water-solon-plugin
CloudEventService Event bus interface water-solon-plugin、rabbitmq-solon-plugin、rocketmq-solon-plugin
CloudLogService Log bus interface water-solon-plugin

attach 2: Unified service configuration specification

notes : Specific configuration , Replace... With the frame name @@ operator

Attribute theory explain Framework availability
solon.cloud.@@.server Service address (ip:port) nacos、consul、water
solon.cloud.@@.token Link token consul
solon.cloud.@@.username Link user name nacos
solon.cloud.@@.password Link password nacos
solon.cloud.@@.alarm Police reception number water
solon.cloud.@@.config.enable Configure service enable ( Default :true) nacos、consul、water
solon.cloud.@@.config.server Service address (ip:port) nacos、consul、water
solon.cloud.@@.config.loadGroup Configuration groups that need to be loaded at startup nacos、water
solon.cloud.@@.config.loadKey It needs to be loaded at startup Key nacos、consul、wate
solon.cloud.@@.config.refreshInterval Configure refresh interval consul
solon.cloud.@@.discovery.enable The registration and discovery service is enabled ( Default :true) nacos、consul、water
solon.cloud.@@.discovery.server Service address (ip:port) nacos、consul、water
solon.cloud.@@.discovery.tags Service Tag consul
solon.cloud.@@.discovery.healthCheckPath Service health check path consul、water
solon.cloud.@@.discovery.healthCheckInterval Service health check interval consul
solon.cloud.@@.discovery.healthDetector Service health reporting indicators consul
solon.cloud.@@.discovery.refreshInterval Service discovery refresh interval consul
solon.cloud.@@.event.enable Event bus service ( Default :true) water、rabbitmq、rocketmq
solon.cloud.@@.event.server Service address (ip:port) water、rabbitmq、rocketmq
solon.cloud.@@.event.exchange Switch or relationship group rabbitmq、rocketmq
solon.cloud.@@.event.queue Specify the queue rabbitmq、rocketmq
solon.cloud.@@.event.hostname Specify the receiving domain water
solon.cloud.@@.event.seal Event signature water
solon.cloud.@@.log.enable Log bus service ( Default :true) water
solon.cloud.@@.log.server Service address (ip:port) water
solon.cloud.@@.log.default Log default recorder water

attach 3: Project address

Project address : https://gitee.com/noear/solon

Solon rpc 1.3.1 Release , Introduction Cloud Interface and configuration specification

  1. [SDK2.2]Windows Azure Cloud Service (35) Use VS2013 Release Azure Cloud Service

    <Windows Azure Platform List of articles > Not updated for a long time BLOG 了 , Today we go on Windows Azure Related content . The author recently put Visual Studio Upgrade to 20 ...

  2. Why RPC, Not simply HTTP Interface

    Reprinted from :http://www.oschina.net/question/271044_2155059?sort=default&p=1#answers There are a lot of Java Of RPC frame , It's based on J ...

  3. Follow me SpringCloud | Chapter 6 :Spring Cloud Config Github Configuration center

    SpringCloud Series of tutorials | Chapter 6 :Spring Cloud Config Github Configuration center Springboot: 2.1.6.RELEASE SpringCloud: Greenwic ...

  4. Spring Cloud Config Implementation configuration center , Just read this one

    Spring Cloud Config yes Spring Cloud The earliest configuration center in the family , Although it was later released Consul It can replace the function of configuration center , however Config It still applies to Spring Clou ...

  5. locomotive wordpress Free universal release module and interface

    locomotive wordpress Free universal release module and interface can be used http://www.ggfenxiang8.com/?p=263

  6. IIS The server Remote Publishing (Web Deploy) To configure VS2010 development environment Windows Server 2008 Server system

    original text :IIS The server Remote Publishing (Web Deploy) To configure VS2010 development environment Windows Server 2008 Server system asp.net There are three common ways to publish a website : They are the ones released on the copy development machine ...

  7. Spring Cloud Config( Configuration center )

    Learn a little every day Programming PDF e-book . Video tutorial free download :http://www.shitanlife.com/code One . brief introduction Spring Cloud Config Provide server and client for external configuration in distributed system ...

  8. 007-spring cloud gateway-GatewayAutoConfiguration The core configuration -RouteDefinition Initialize load

    One .RouteDefinitionLocator stay Spring-Cloud-Gateway Of GatewayAutoConfiguration It will be loaded during initialization loading RouteDefinitionLocat ...

  9. MVC Publish to IIS Configuration method in

    MVC Publish to IIS Configuration method in  http://msdn.microsoft.com/zh-cn/library/gg703322(v=vs.98).aspx

  10. spring cloud Eureka client To configure (consumer adopt Eureka Initiate right provider Call to )

    Reference resources :http://www.ityouknow.com/springcloud/2017/05/12/eureka-provider-constomer.html springboot edition :2.0.3 ...

Random recommendation

  1. CAD The planning results are put into the database GIS_SDE The analysis of transformation

    problem : 1) In the application of the project, it is required that CAD Reasonable storage of planning results GIS SDE in , On the premise of establishing a set of relatively standardized standards , how “ Low tech . The fool ” Achieve planning data update management . Versioning is an urgent problem . 2) CAD As a data source , Different ...

  2. Android install BusyBox( samsung N7108)

    Recent company Android app test , Assign tasks to monitor APP Memory .CPU Occupancy rate . Because Android is based on linux Development , So it's easy to use Linux Monitoring related commands . Ideas are always good , The reality is always harsh , Use Samsung Galaxy Note ...

  3. L1 - Operating mechanism

    var name = 'kl'; function person(){ alert(name); var name = 'ko'; } person(); This code output ‘undefined’, This kind of appearance ...

  4. [SQL Basic course ] 1-5 Table deletion and update

    [SQL Basic course ] 1-5 Table deletion and update The deletion of the table grammar DROP TABLE < Table name >; The laws of 1-12 The deleted table cannot be recovered Update of table definition grammar ALTER TABLE< Table name > ...

  5. autoLayer: A basic layout

    I can't blog , If you don't write well, please forgive me , This autoLayer I'll go straight to the picture above : My environment :IDE(Xcode6)SDK(IOS8) preparation : Find a bar chart psd( Because I can't cut a picture , I'll just briefly describe the image processing ), ...

  6. Native JavaScript How to solve the problem that the parent element finds the child element of the specified class name

    problem : We know that the class name of an element is right And the class name of the ancestor element of this element is parent, Now I want to go through the original JavaScript Get this class named right The elements of . My thoughts : Recursion . First, identify the known ancestral elements ( In the question pa ...

  7. Use supervisor Management process

    Supervisor (http://supervisord.org) It's a use. Python Write process management tools , It's very convenient to start . restart . Close the process ( not only Python process ). Except for a single process ...

  8. centOS7 Compiled on hadoop-2.7.7

    One . Read the compiled documentation stay hadoop Source package root directory has a BUINDING.txt The file of , The file explains how to compile hadoop Some compilation needed hadoop Some compilation environment related things needed . Different hadoop Version requirements are ...

  9. The first 1 Chapter ssh Command and SSH Service details

    Basic services series :http://www.cnblogs.com/f-ck-need-u/p/7048359.html This paper deals with SSH The connection verification mechanism is analyzed in detail , It also introduces in detail ssh All kinds of client tools ...

  10. BZOJ3022 : [Balkan2012]The Best Teams

    Rank players and questions by age , To get rid of the age limit . After sorting all players horizontally, maintain the line tree , Obviously, the optimal solution must be greedy from big to small . Each node in the segment tree maintains : $g[0/1]:r+1$ No election / When I choose ,$l$ Choose or not . $ ...