SpringCloud Tutorial 3, the usage of Feign;SpringCloud系列教程3,Feign的使用

显然,Spring Cloud项目除了生产者,还需要有消费者,Spring CLoud提供了两种方式的消费者,Ribbon和Feign。本文介绍Feign的使用。
Obviously, there are not only producers but also consumers in Spring Cloud projects. it provides two categories of producers, Ribbon and Feign. This blog talks about the usage of Feign.
首先,新建一个子模块,添加如下依赖。
Firs[……]

Read more

SpringCloud Tutorial 7, the usage of Spring Boot Admin;SpringCloud系列教程7,Spring Boot Admin的使用

显然,在微服务架构中,我们需要一个监控中心用于监控所有服务的状态,以及服务器资源占用,Spring社区提供了一个解决方案,Spring Boot Admin。
Obviously, we need a monitoring center to monitor the statuses of all services and the occupation of the servers in microservice architectures. Spring Community provides a solution, Spring Boot Admin.
接下来,我们开始建立Sprin[……]

Read more

SpringCloud Tutorial 6, the usage of Spring Cloud Sleuth & Zipkin;SpringCloud系列教程6,Spring Cloud Sleuth 和 Zipkin的使用

显然,在分布式系统中,我们需要一个追踪系统,Spring Cloud提供了一个解决方案—— Spring Cloud Sleuth,它可以和Dapper,Zipkin或者HTrace一起使用。本文使用的是Zipkin,这是一个基于Google Dapper论文开发的一个开源分布式追踪系统,它被用于定位微服务架构中延迟问题。
Obviously, in a distributed system, we need a tracing system, Spring Cloud provides a solution, Spring Cloud Sleuth, which can be used[……]

Read more

SpringCloud Tutorial 4, the usage of Spring Cloud Config;SpringCloud系列教程4,Spring Cloud Config的使用

显然,在分布式系统中,为了方便修改程序的属性,我们需要一个配置中心,Spring Cloud提供了一个解决方案——Spring Cloud Config.
Obviously, in distributed systems, we need a config center to change the properties easily. Spring Cloud provides a solution, Spring Cloud Config.
Spring Cloud Config包含两个部分,服务端和客户端.
Spring Cloud Config has two parts, th[……]

Read more

SpringCloud Tutorial 1,Eureka Server;SpringCloud系列教程1,Eureka Server

Spring Cloud是一个基于Springboot项目开发的,它为开发者快速开发分布式系统提供了一系列通用的工具。
Spring Cloud is built on Springboot, and it provides tools for the common patterns in distributed systems.
Eureka Server是Spring Cloud推荐的服务注册中心,本文介绍Eureka Server的搭建。
Eureka Server is the recommended Service Registration. This[……]

Read more

SpringCloud Tutorial 5, the usage of Spring Cloud Gateway;SpringCloud系列教程5,Spring Cloud Gateway的使用

显然,在分布式系统中,为了将业务暴露给终端用户,同时平衡服务器压力,我们需要一个服务网关,Spring Cloud提供了一个解决方案—— Spring Cloud Gateway.
Obviously, in distributed systems, we need a gateway to expose services to terminal users and balance the pressure of the back-end servers. Spring Cloud provides a solution, Spring Cloud Gateway.
首先,新建一个子模[……]

Read more

VUE的SSR部署–deploy SSR of VUE

官方推荐使用这两个命令完成服务端渲染
the official recommended commands are the following two,
1
2
nuxt build
nuxt start
官方推荐的 package.json 配置如下:
here is the recommended package.json,
1
2
3
4
5
6
7
8
{
  "name": "my-app",
  "dependencies": {
    "nuxt": "latest"
  },
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt bui[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=10">Read more</a></p>

通过SMTP发送e-mail–Use SMTP to send emails

经常,我们需要在代码中实现发送邮件功能,我们可以通过SMTP连接邮件服务器,然后发送邮件,具体工具类如下:
Usually, we need to send e-mails in projects, we can use SMTP to connect to the mail server to send the email. Here is the tool class
1
2
3
4
5
6
package net.gerry.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.mail.*;[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=8">Read more</a></p>

Nginx开启Gzip–Open Gzip in Nginx

为了节约流量,我们可以在Nginx上配置如下,
To save the flow, we can configure the Nginx like this,
1
2
3
gzip on;#开启Gzip--open the Gzip
gzip_min_length 1k;#1k以上开启Gzip--only open the Gzip to the files whose size are above 1k
gzip_buffers 4 16k;#每次以原始数据以16k为单位的4倍申请内存--allocate the memory in the size of 4 times of the si[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=6">Read more</a></p>