Giter VIP home page Giter VIP logo

fastdfs-spring-boot-starter's Introduction

fastdfs-spring-boot-starter

一个同时兼容SpringBoot1.x和2.x的高性能FastDFS客户端.

  • 自动添加依赖

  • 初始化配置项

  • 基于Commons Pool2 实现的高性能连接池

  • 更多操作FastDFS的API

快速开始

  • 下载.

    git clone https://github.com/bluemiaomiao/fastdfs-spring-boot-starter.git
    cd fastdfs-spring-boot-starter
  • 安装到本地仓库.

    mvn clean install
  • 添加到项目.

    <dependency>
        <groupId>com.bluemiaomiao</groupId>
        <artifactId>fastdfs-spring-boot-starter</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
  • 在主配置类上添加注解 (@EnableFastdfsClient).

    @EnableFastdfsClient
    @SpringBootApplication
    public class DemoApplication {
    
        @Autowired
        private FastdfsClientService fastdfsClientService;
    
        public static void main(String[] args) {
            SpringApplication.run(DemoApplication.class, args);
        }
    }
  • 添加配置条目(application.properties).

    fastdfs.nginx-servers=192.168.80.2:8000,192.168.80.3:8000,192.168.80.4:8000
    fastdfs.tracker-servers=192.168.80.2:22122,192.168.80.3:22122,192.168.80.4:22122
    fastdfs.http-secret-key=2scPwMPctXhbLVOYB0jyuyQzytOofmFCBIYe65n56PPYVWrntxzLIDbPdvDDLJM8QHhKxSGWTcr+9VdG3yptkw
    fastdfs.http-anti-steal-token=true
    fastdfs.http-tracker-http-port=8080
    fastdfs.network-timeout=30
    fastdfs.connect-timeout=5
    fastdfs.connection-pool-max-idle=18
    fastdfs.connection-pool-min-idle=2
    fastdfs.connection-pool-max-total=18
    fastdfs.charset=UTF-8
  • 添加配置条目(application.yml).

    fastdfs:
      charset: UTF-8
      connect-timeout: 5
      http-secret-key: 2scPwMPctXhbLVOYB0jyuyQzytOofmFCBIYe65n56PPYVWrntxzLIDbPdvDDLJM8QHhKxSGWTcr+9VdG3yptkw
      network-timeout: 30
      http-anti-steal-token: true
      http-tracker-http-port: 8080
      connection-pool-max-idle: 20
      connection-pool-max-total: 20
      connection-pool-min-idle: 2
      nginx-servers: 192.168.80.2:8000,192.168.80.3:8000,192.168.80.4:8000
      tracker-servers: 192.168.80.2:22122,192.168.80.3:22122,192.168.80.4:22122
  • 即刻享受它带来的便利.

fastdfs-spring-boot-starter's People

Contributors

bluemiaomiao avatar

Watchers

James Cloos avatar 769249234@qq.com 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.