Spring Cloud Alibaba aims to provide a one-stop solution for microservices development. This prjoect includes the required components for developing distributed applications and services, so that developers can develop distributed applications easily with the Spring Cloud programming models.
https://rocketmq.apache.org[RocketMQ] is an open-source distributed message system. It is based on highly available distributed cluster technologies and provides message publishing and subscription service with low latency and high stability. RocketMQ is widely used in a variety of industries, such as decoupling of asynchronous communication, enterprise sulotions, financial settlements, telecommunication, e-commerce, logistics, marketing, social media, instant messaging, mobile applications, mobile games, vedios, IoT, and Internet of Vehicles.
@ -16,7 +16,7 @@ It has the following features:
* Billion-level message accumulation capability
### RocketMQ Usages
=== RocketMQ Usages
* Download RocketMQ
@ -74,7 +74,7 @@ sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
```
### Introduction of Spring Cloud Stream
=== Introduction of Spring Cloud Stream
Spring Cloud Stream is a microservice framework used to build architectures based on messages. It helps you to create production-ready single-server Spring applications based on SpringBoot, and connects with Broker using `Spring Integration`.
@ -114,7 +114,7 @@ All the message types in this code are provided by the `spring-messaging`module.
**The lower layer of Spring Cloud Stream also implements various code abstractions based on the previous code.**
### How to use Spring Cloud Alibaba RocketMQ Binder ###
=== How to use Spring Cloud Alibaba RocketMQ Binder ###
For using the Spring Cloud Alibaba RocketMQ Binder, you just need to add it to your Spring Cloud Stream application, using the following Maven coordinates:
@ -134,7 +134,7 @@ Alternatively, you can also use the Spring Cloud Stream RocketMQ Starter:
</dependency>
```
### How Spring Cloud Alibaba RocketMQ Binder Works
=== How Spring Cloud Alibaba RocketMQ Binder Works
This is the implementation architecture of Spring Cloud Stream RocketMQ Binder:
SCS RocketMQ Binder support `MessageSource`,which can receive messages by pull mode:
@ -222,9 +222,9 @@ public class MQApplication {
}
```
### Configuration Options
=== Configuration Options
#### RocketMQ Binder Properties
==== RocketMQ Binder Properties
spring.cloud.stream.rocketmq.binder.name-server::
The name server of RocketMQ Server(Older versions use the namesrv-addr configuration item).
@ -248,7 +248,7 @@ The trace topic for message trace.
Default: `RMQ_SYS_TRACE_TOPIC`.
#### RocketMQ Consumer Properties
==== RocketMQ Consumer Properties
The following properties are available for RocketMQ producers only and must be prefixed with `spring.cloud.stream.rocketmq.bindings.<channelName>.consumer.`.
@ -284,7 +284,7 @@ Time interval of message consume retry for orderly consume.
+
Default: `1000`.
#### RocketMQ Provider Properties
==== RocketMQ Provider Properties
The following properties are available for RocketMQ producers only and must be prefixed with `spring.cloud.stream.rocketmq.bindings.<channelName>.producer.`.
As microservices become popular, the stability of service calls is becoming increasingly important. https://github.com/alibaba/Sentinel[Sentinel] takes "flow" as the breakthrough point, and works on multiple fields including flow control, circuit breaking and load protection to protect service reliability.
@ -12,7 +12,7 @@ https://github.com/alibaba/Sentinel[Sentinel] has the following features:
* *Extensive Open-Source Ecosystem*: Sentinel provides out-of-box modules that can be easily integrated with other open-source frameworks/libraries, such as Spring Cloud, Dubbo, and gRPC. To use Sentinel, you only need to introduce the related dependency and make a few simple configurations.
* *Sound SPI Extensions*: Sentinel provides easy-to-use and sound SPI extension interfaces. You can customize logics with the SPI extensions quickly, for example, you can define your own rule management, or adapt to specific data sources.
### How to Use Sentinel
=== How to Use Sentinel
If you want to use Sentinel in your project, please use the starter with the group ID as `com.alibaba.cloud` and the artifact ID as `spring-cloud-starter-alibaba-sentinel`.
@ -76,7 +76,7 @@ public class TestController {
}
```
##### Sentinel Dashboard
===== Sentinel Dashboard
Sentinel dashboard is a lightweight console that provides functions such as machine discovery, single-server resource monitoring, overview of cluster resource data, as well as rule management. To use these features, you only need to complete a few steps.
If there is conflict with the 8080 port, you can use `-Dserver.port=new port` to define a new port.
#### Configure the Dashboard
==== Configure the Dashboard
.application.yml
----
@ -123,7 +123,7 @@ The port number specified in `spring.cloud.sentinel.transport.port` will start a
For more information about Sentinel dashboard, please refer to https://github.com/alibaba/Sentinel/wiki/%E6%8E%A7%E5%88%B6%E5%8F%B0[Sentinel Dashboard].
### OpenFeign Support
=== OpenFeign Support
Sentinel is compatible with the https://github.com/OpenFeign/feign[OpenFeign] component. To use it, in addition to introducing the `sentinel-starter` dependency, complete the following 2 steps:
@ -164,7 +164,7 @@ NOTE: The resource name policy in the corresponding interface of Feign is:http
The corresponding resource name of the `echo` method in the `EchoService` interface is `GET:http://service-provider/echo/{str}`.
### RestTemplate Support
=== RestTemplate Support
Spring Cloud Alibaba Sentinel supports the protection of `RestTemplate` service calls using Sentinel. To do this, you need to add the `@SentinelRestTemplate` annotation when constructing the `RestTemplate` bean.
@ -208,7 +208,7 @@ Sentinel RestTemplate provides two granularities for resource rate limiting:
NOTE: Take Http GET `https://www.taobao.com/test` as an example. The corresponding resource names have two levels of granularities, `GET:https://www.taobao.com` and `GET:https://www.taobao.com/test`.
### Dynamic Data Source Support
=== Dynamic Data Source Support
`SentinelProperties` provide `datasource` attribute to configure datasource.
@ -253,7 +253,7 @@ NOTE: XML format is not supported by default. To make it effective, you need to
To learn more about how dynamic data sources work in Sentinel, refer to https://github.com/alibaba/Sentinel/wiki/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%99%E6%89%A9%E5%B1%95[Dynamic Rule Extension].