Giter VIP home page Giter VIP logo

muses's Introduction

Muses

基于SpringCloudAlibaba技术栈微服务模板项目

模块

模块 描述
boot 启动
gateway 网关
web-parent Web服务模块
rest-parent Rest服务模块
boot-parent Boot模块
service-parent 内部服务模块
docs 配置文档

规范

开发日志

  • [+] 添加功能
  • [-] 删除功能
  • [*] 修改功能
  • [!] 危险操作
  • [#] 没有完成
  • [~] 日常任务

符号说明

  • +:必选
  • *:可选

安全

Web服务

Web服务使用传统Session记录状态,通过RedisSession实现共享,需要用户自己通过拦截器或者Spring Security实现认证授权。

Session失效

如果Web登录成功访问没有集成RedisSession的项目,那么就会导致Session失效。 解决方法设置sessioncookie.namecookie.domain或者cookie.path进行区分。

Rest服务

Rest服务使用OAuth2服务通过网关实现统一认证鉴权

配置

配置统一放在Nacos配置中心通过bootstrap.yml加载:

spring:
  application:
    name: acgist
  main:
    allow-bean-definition-overriding: true
  profiles:
    active: @profile@
  cloud:
    nacos:
      username: nacos
      password: nacos
      discovery:
        namespace: ${spring.profiles.active}
        server-addr: @nacos@
      config:
        namespace: ${spring.profiles.active}
        file-extension: yml
        refreshable-dataids: redis.yml, dubbo.yml

配置备份./docs/nacos_config.zip

关机

  • 服务下线
  • kill -2 pid

系统配置

# 系统编号(负数自动生成):主要用于生成ID,相同服务建议设置不同编号。
system.sn=-1
# 系统端口:随机生成
system.port=8080
# 线程初始数量
system.thread.min=2
# 线程最大数量
system.thread.max=10
# 线程队列最大长度
system.thread.size=100000
# 线程活跃时间:秒
system.thread.live=30
# 系统序列化类型
system.serializer.type=jdk|jackson
# 是否自动配置MVC:拦截器、参数注解
system.web.mvc=true|false
system.rest.mvc=true|false
# 慢请求统计时间:毫秒
system.gateway.slow.request.duration=1000
# 静态资源地址
system.static.host=//localhost:8888
# 网关Topic
system.topic.gateway=topic-gateway
# 是否允许下线自动关机
system.shutdown.enable=true
# 自动关机等待时间:秒
system.shutdown.gracefully=30
# 缓存前缀
system.cache.prefix=cache::

Maven配置

# 应用启动JVM参数
system.maven.jvm=
# 应用启动JVM参数:xms
system.maven.xms=256M
# 应用启动JVM参数:xmx
system.maven.xmx=512M
# 是否忽略打包
system.maven.unpack=true
# 作者
system.maven.vendor=acgist
# 模块
system.maven.module=com.acgist.muses
# 项目的根目录
system.maven.basedir=${project.basedir}
# 版本
system.maven.version=1.0.0
# 编码
system.maven.encoding=UTF-8

端口

模块 端口
gateway 8888
rest-oauth2 9999
web [18000,19000)
rest [19000,20000)

固定端口

# 配置
server.port=8888
# 命令
java -jar appliation.jar --server.port=8888
java -Dserver.port=8888 -jar appliation.jar
java -jar appliation.jar --system.port=8888
java -Dsystem.port=8888 -jar appliation.jar

完全随机

server.port=0

范围随机

server.port=${system.port:8080}

开发

服务实例里面所有业务逻辑都是测试使用,可以根据自己实际情况进行修改删除。

muses's People

Contributors

acgist avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.