微服务2

1.introduction to springboot

sping beans, rest apis using springflux,  the swagger, Open-Api-based documentation, Springfox, data persistance, sql and nosql database

no-blocking synchronous api(Spring WebFlux) and message-based asynchronous srvices(spring cloud stream)

docker: start or stop our microservice landscape with a single command.

2.learning about Springboot

* spring, j2ee, springboot

3.convention for configuration and fat jar files

*convention over configuration

*war, fat jar

4.the magic @SpringbootApplication annotation:

* it enables the convention-based auto-configuration mechanism

* it enables component scanning

* it enables Application class isself to become a configuration class

5.component scanning

*autowiring

6.java-based configuration

* @configuration

7.begin with spring webflux

* springframework 5.0

* project reactor

* Spring WebFlux, which supports development of active, that is, non-blocking, http-clients and serivces.

* two different programming models:

  1. annotation-based imperative style

  2. a new function-based model by routers and handlers

* a fully http reactive client

* servlet 3.1 or higher

* netty

8.Code example of setting up rest service with Spring WebFlux

* starter dependencies that bring in specific features, togethre with the dependencies each feature requires

9.starter dependencies

* Gradle, implementation(org.springframework.root:spring-boot-starter-webflux)

* microservices started, springwebflux detected and configed

* netty, change to tomcat, exclude

10.property files

* .properties or yaml

11. sample Rest Controller

12.exploring SpringFox

* swagger inspects webflux and swagger-based annotation

13, Understanding Spring Data

* persisting data in various Database engine, ranging from relational(mysql), documental(MongoDB), key-value(Redis) and graphic database(Neo4j)

* Spring Data project is divided into different sub projects

* entity and repositories generalize how data is persisted and accessed from all varities of database.

Entity:

14. repositores

* ReactiveCRUDRepository, which enables reactive repositories and returns mono or flux.

* Mono and Flux are reactive streams that are capable of returning 0...1 or 0...n entities as they become available in the stream.

Understanding Spring Cloud Stream

* support for Apache Kafka and rabbitMQ

* the core concepts:message, publisher, subscriber, channel, binder

* the actual messaging system to be used is determined at the runtime. conventions can be overwritten, such as consumer groups, paritioning, persistance, durability, and error handling, such as retries and dead letter queue handling.

15. learning about docker

* build, dockerfile, Docker Compose, Docker image, Docker container

* users, processes, file systems, networking

* cgroup limits the amount of cpu and memory  that container is allowed to consume.\

* isolation

16. Summary

* WebFlux reactive, non-blocking REST services; netty and servlet 3.1;

* spring Data, Entities, and Repositories

* Spring cloud stream, streaming abstraction, RabbitMQ, Apache Kafka, Binder

* Docker, linux namespacies, cgroup, kubernates

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值