test
maven-clean-plugin
3.1.0
maven-resources-plugin
3.0.2
maven-compiler-plugin
3.8.0
maven-surefire-plugin
2.22.1
maven-jar-plugin
3.0.2
maven-install-plugin
2.5.2
maven-deploy-plugin
2.8.2
maven-site-plugin
3.7.1
maven-project-info-reports-plugin
3.0.0
application.yml
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
spring:
application:
name: product-service-zuul
zuul:
routes:
api-a:
path: /api-data/** #访问服务路径
serviceId: PRODUCT-DATA-SERVICE #服务serviceId
api-b:
path: /api-view/**
serviceId: PRODUCT-VIEW-SERVICE-FEIGN
启动类
ProductServiceZuulApplication,加了个注解@EnableZuulProxy。
package edu.hpu.springcloud;
import cn.hutool.core.util.NetUtil;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
@SpringBootApplication
@EnableZuulProxy
@EnableEurekaClient
@EnableDiscoveryClient
public class ProductServiceZuulApplication {
public static void main(String[] args) {
int port = 8040;
if(!NetUtil.isUsableLocalPort(port)) {
System.err.printf(“端口%d被占用了,无法启动%n”, port );
System.exit(1);
}
new SpringApplicationBuilder(ProductServiceZuulApplication.class).properties(“server.port=” + port).run(args);
最后
手绘了下图所示的kafka知识大纲流程图(xmind文件不能上传,导出图片展现),但都可提供源文件给每位爱学习的朋友
r(ProductServiceZuulApplication.class).properties(“server.port=” + port).run(args);
最后
手绘了下图所示的kafka知识大纲流程图(xmind文件不能上传,导出图片展现),但都可提供源文件给每位爱学习的朋友
[外链图片转存中…(img-d2cELjaR-1714468620834)]