spring cloud 集成的源码

153 篇文章 ¥99.90 ¥299.90
本文介绍了Spring Cloud的集成示例,包括sc-commons、sc-eureka、sc-eureka-consumer系列(freemarker、jsp、thymeleaf)以及sc-eureka-hystrix和sc-feign。详细说明了启动流程,提供了数据库初始化和各服务访问地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://github.com/wangxinforme/sc

sc 介绍

它是一个基于SpringCloud的分布式服务示例项目、集成有eureka、ribbon、feign、hystrix组件等,消费端有JSP、freemarker、thymeleaf三个版本,同时集成了shiro、swagger2等,后面会接着完善

包含工程有:
  • sc-commons:用于放common公共相关类的工程,所有工程都可以引用。

  • sc-eureka:Netflix Eureka云端负载均衡,一个基于REST的服务,用于定位服务,以实现云端的负载均衡和中间层服务器的故障转移。

  • sc-eureka-consumer-freemarker:client端,即consumer服务消费者,前端采用的是freemarker,集成了shiro。

  • sc-eureka-consumer-jsp:client端,即consumer服务消费者,前端采用的是jsp,集成了shiro。

  • sc-eureka-consumer-thymeleaf:client端,即consumer服务消费者,前端采用的是thymeleaf,集成了shiro。

  • sc-eureka-hystrix:集成hystrix的示例

  • sc-eureka-provider:server端,即provider服务提供端,端口是随机分配的,可以启动多个服务对ribbon验证服务负载,当中集成了swagger2

  • sc-feign:SpringCloud Netflix Feign,声明的接口。

示例启动
  • 初始化数据库,将sc/ddl/mysql_test.sql脚本初始化在默认数据库当中

  • 按顺序依次启动项目工程: sc-eureka、sc-eureka-provider、sc-eureka-consumer-freemarker、sc-eureka-consumer-jsp、sc-eureka-consumer-thymeleaf 启动方式,运行: com.wangxin.Application.main(String[]) 方法

  • 访问 sc-eureka 浏览器访问http://localhost:1111 ,Application表格当中可以看到注册上来的server与client,表明启动都成功了

  • 访问 sc-eureka-provider 浏览器访问http://localhost:2000/msg,看到“来自于server ...”则证明访问成功 浏览器访问http://localhost:2000,进入swagger2 ui页面

  • 访问 sc-eureka-consumer-freemarker 浏览器访问http://localhost:3000,会看到登录页面

  • 访问 sc-eureka-consumer-jsp 浏览器访问http://localhost:4000,会看到登录页面

  • 访问 sc-eureka-consumer-thymeleaf 浏览器访问http://localhost:5000,会看到登录页面


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值