7 changed files with 147 additions and 48 deletions
@ -1,48 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package org.springblade.auth.config; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.data.redis.connection.RedisConnectionFactory; |
||||
import org.springframework.security.oauth2.provider.token.TokenStore; |
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore; |
||||
|
||||
/** |
||||
* Redis TokenStore |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Configuration |
||||
@AllArgsConstructor |
||||
public class RedisTokenStoreConfiguration { |
||||
/** |
||||
* redis连接工厂 |
||||
*/ |
||||
private RedisConnectionFactory redisConnectionFactory; |
||||
|
||||
/** |
||||
* 用于存放token |
||||
*/ |
||||
@Bean |
||||
@ConditionalOnProperty(prefix = "blade.security.oauth2", name = "storeType", havingValue = "redis") |
||||
public TokenStore redisTokenStore() { |
||||
return new RedisTokenStore(redisConnectionFactory); |
||||
} |
||||
} |
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>blade-ops</artifactId> |
||||
<groupId>org.springblade</groupId> |
||||
<version>2.1.0.RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>blade-zipkin</artifactId> |
||||
<name>${project.artifactId}</name> |
||||
<version>${bladex.project.version}</version> |
||||
<packaging>jar</packaging> |
||||
|
||||
<dependencies> |
||||
<!--Blade--> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-common</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-launch</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-tool</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springblade</groupId> |
||||
<artifactId>blade-core-cloud</artifactId> |
||||
</dependency> |
||||
<!--Zipkin--> |
||||
<dependency> |
||||
<groupId>io.zipkin.java</groupId> |
||||
<artifactId>zipkin-server</artifactId> |
||||
<version>2.12.3</version> |
||||
<exclusions> |
||||
<exclusion> |
||||
<artifactId>log4j-slf4j-impl</artifactId> |
||||
<groupId>org.apache.logging.log4j</groupId> |
||||
</exclusion> |
||||
</exclusions> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.zipkin.java</groupId> |
||||
<artifactId>zipkin-autoconfigure-ui</artifactId> |
||||
<version>2.12.3</version> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
@ -0,0 +1,37 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package org.springblade.zipkin; |
||||
|
||||
import org.springblade.core.launch.BladeApplication; |
||||
import org.springblade.core.launch.constant.AppConstant; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import zipkin2.server.internal.EnableZipkinServer; |
||||
|
||||
/** |
||||
* Zipkin启动器 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@EnableZipkinServer |
||||
@SpringBootApplication |
||||
public class ZipkinApplication { |
||||
|
||||
public static void main(String[] args) { |
||||
BladeApplication.run(AppConstant.APPLICATION_ZIPKIN_NAME, ZipkinApplication.class, args); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,18 @@
|
||||
server: |
||||
port: 9411 |
||||
undertow: |
||||
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 |
||||
io-threads: 4 |
||||
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 |
||||
worker-threads: 20 |
||||
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 |
||||
buffer-size: 1024 |
||||
# 是否分配的直接内存 |
||||
direct-buffers: true |
||||
|
||||
#zipkin启动报错无法访问的解决方法 |
||||
management: |
||||
metrics: |
||||
web: |
||||
server: |
||||
auto-time-requests: false |
Loading…
Reference in new issue