fastdfs java 连接池

编程入门 行业动态 更新时间:2024-10-26 21:20:53

fastdfs java <a href=https://www.elefans.com/category/jswz/34/1766187.html style=连接池"/>

fastdfs java 连接池

FastDFS连接池

使用common-pool2

直持spring

通过nginx进行http访问

支持防盗链

xmlns=""

xsi:schemaLocation=" .xsd">

spring boot

## application.yml

fastdfs:

g_connect_timeout: 60

g_network_timeout: 80

g_anti_steal_token: false

poolConfig:

maxTotal: 100

maxIdle: 10

protocol: http://

tracker_servers: 127.0.0.1:22122

g_tracker_http_port: 8080

nginx_address: 127.0.0.1:80

@Configuration

public class FastDfsConfig {

public static final String ROOT_CONFIG_PREFIX = "fastdfs";

@Resource

private FastDFSTemplateFactory fastDFSFactory;

@Bean(initMethod = "init")

@ConfigurationProperties(prefix = ROOT_CONFIG_PREFIX)

public FastDFSTemplateFactory fastDFSFactory() {

return new FastDFSTemplateFactory();

}

@Bean

public FastDFSTemplate fastDFSTemplate() {

return new FastDFSTemplate(fastDFSFactory);

}

}

如需要缩略图大小

可以参考nginx配置image_filter

location ~/group1/M00 {

alias /fastdfs/storage/data;

ngx_fastdfs_module;

set $flag '';

if ($args ~* "width=([1-9]\d*)") {

set $width $1;

set $flag "${flag}A";

}

if ($args ~* "height=([1-9]\d*)") {

set $height $1;

set $flag "${flag}B";

}

if ($flag != AB){

set $height 9999;

set $width 9999;

}

image_filter resize $width $height;

}

更多推荐

fastdfs java 连接池

本文发布于:2024-02-05 02:35:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1673457.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接池   fastdfs   java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!