mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 17:38:32 +08:00
springboot-actuator
This commit is contained in:
parent
2026535275
commit
cc2f20dd94
11
build.gradle
11
build.gradle
@ -201,9 +201,9 @@ subprojects {
|
|||||||
|
|
||||||
//kafka support
|
//kafka support
|
||||||
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
|
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
|
||||||
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '2.5.0'
|
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '2.6.1'
|
||||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||||
compile group: 'org.springframework.kafka', name: 'spring-kafka', version: '2.5.2.RELEASE'
|
compile group: 'org.springframework.kafka', name: 'spring-kafka', version: '2.6.6'
|
||||||
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
|
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
|
||||||
compile group: 'org.springframework.retry', name: 'spring-retry', version: '1.3.0'
|
compile group: 'org.springframework.retry', name: 'spring-retry', version: '1.3.0'
|
||||||
|
|
||||||
@ -215,6 +215,8 @@ subprojects {
|
|||||||
compile group: 'org.springframework.boot', name: 'spring-boot', version: "${springBootVersion}"
|
compile group: 'org.springframework.boot', name: 'spring-boot', version: "${springBootVersion}"
|
||||||
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
|
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
|
||||||
compile group: 'org.springframework.boot', name: 'spring-boot-actuator', version: "${springBootVersion}"
|
compile group: 'org.springframework.boot', name: 'spring-boot-actuator', version: "${springBootVersion}"
|
||||||
|
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
|
||||||
|
compile group: 'org.springframework.boot', name: 'spring-boot-actuator-autoconfigure', version: "${springBootVersion}"
|
||||||
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: "${springBootVersion}"
|
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: "${springBootVersion}"
|
||||||
compile group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: "${springBootVersion}"
|
compile group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: "${springBootVersion}"
|
||||||
compile group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: "${springBootVersion}"
|
compile group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: "${springBootVersion}"
|
||||||
@ -320,7 +322,10 @@ subprojects {
|
|||||||
compile group: 'org.ogce', name: 'xpp3', version: '1.1.6'
|
compile group: 'org.ogce', name: 'xpp3', version: '1.1.6'
|
||||||
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.10'
|
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.10'
|
||||||
compile group: 'org.passay', name: 'passay', version: '1.6.0'
|
compile group: 'org.passay', name: 'passay', version: '1.6.0'
|
||||||
|
compile group: 'io.micrometer', name: 'micrometer-core', version: '1.6.4'
|
||||||
|
compile group: 'org.latencyutils', name: 'LatencyUtils', version: '2.0.3'
|
||||||
|
compile group: 'org.codehaus.woodstox', name: 'stax2-api', version: '4.2.1'
|
||||||
|
|
||||||
//docs
|
//docs
|
||||||
compile group: 'org.mapstruct', name: 'mapstruct', version: '1.4.1.Final'
|
compile group: 'org.mapstruct', name: 'mapstruct', version: '1.4.1.Final'
|
||||||
compile group: 'io.swagger', name: 'swagger-annotations', version: "${swaggerVersion}"
|
compile group: 'io.swagger', name: 'swagger-annotations', version: "${swaggerVersion}"
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.actuate.endpoint.http.ActuatorMediaType;
|
||||||
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
|
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
|
||||||
import org.springframework.boot.web.server.ErrorPage;
|
import org.springframework.boot.web.server.ErrorPage;
|
||||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||||
@ -174,6 +175,8 @@ public class MvcAutoConfiguration implements InitializingBean {
|
|||||||
new MappingJackson2HttpMessageConverter();
|
new MappingJackson2HttpMessageConverter();
|
||||||
ArrayList<MediaType> mediaTypesList = new ArrayList<MediaType>();
|
ArrayList<MediaType> mediaTypesList = new ArrayList<MediaType>();
|
||||||
mediaTypesList.add(MediaType.APPLICATION_JSON);
|
mediaTypesList.add(MediaType.APPLICATION_JSON);
|
||||||
|
mediaTypesList.add(MediaType.valueOf(ActuatorMediaType.V2_JSON));
|
||||||
|
mediaTypesList.add(MediaType.valueOf(ActuatorMediaType.V3_JSON));
|
||||||
//mediaTypesList.add(MediaType.TEXT_PLAIN);
|
//mediaTypesList.add(MediaType.TEXT_PLAIN);
|
||||||
mappingJacksonHttpMessageConverter.setSupportedMediaTypes(mediaTypesList);
|
mappingJacksonHttpMessageConverter.setSupportedMediaTypes(mediaTypesList);
|
||||||
return mappingJacksonHttpMessageConverter;
|
return mappingJacksonHttpMessageConverter;
|
||||||
|
|||||||
@ -49,19 +49,19 @@ public class RedisAutoConfiguration implements InitializingBean {
|
|||||||
public RedisConnectionFactory redisConnFactory(
|
public RedisConnectionFactory redisConnFactory(
|
||||||
@Value("${spring.redis.host}")
|
@Value("${spring.redis.host}")
|
||||||
String host,
|
String host,
|
||||||
@Value("${spring.redis.port}")
|
@Value("${spring.redis.port:6379}")
|
||||||
int port,
|
int port,
|
||||||
@Value("${spring.redis.timeout}")
|
@Value("${spring.redis.timeout:10000}")
|
||||||
int timeout,
|
int timeout,
|
||||||
@Value("${spring.redis.password}")
|
@Value("${spring.redis.password}")
|
||||||
String password,
|
String password,
|
||||||
@Value("${spring.redis.lettuce.pool.max-active}")
|
@Value("${spring.redis.lettuce.pool.max-active:-1}")
|
||||||
int maxActive,
|
int maxActive,
|
||||||
@Value("${spring.redis.jedis.pool.max-wait}")
|
@Value("${spring.redis.jedis.pool.max-wait:1000}")
|
||||||
int maxWait,
|
int maxWait,
|
||||||
@Value("${spring.redis.jedis.pool.max-idle}")
|
@Value("${spring.redis.jedis.pool.max-idle:100}")
|
||||||
int maxIdle,
|
int maxIdle,
|
||||||
@Value("${spring.redis.lettuce.pool.min-idle}")
|
@Value("${spring.redis.lettuce.pool.min-idle:0}")
|
||||||
int minIdle) {
|
int minIdle) {
|
||||||
_logger.debug("redisConnFactory init .");
|
_logger.debug("redisConnFactory init .");
|
||||||
RedisConnectionFactory factory = new RedisConnectionFactory();
|
RedisConnectionFactory factory = new RedisConnectionFactory();
|
||||||
|
|||||||
@ -35,10 +35,10 @@ public class EmailConfig {
|
|||||||
@Value("${spring.mail.host}")
|
@Value("${spring.mail.host}")
|
||||||
private String smtpHost;
|
private String smtpHost;
|
||||||
|
|
||||||
@Value("${spring.mail.port}")
|
@Value("${spring.mail.port:465}")
|
||||||
private Integer port;
|
private Integer port;
|
||||||
|
|
||||||
@Value("${spring.mail.properties.ssl}")
|
@Value("${spring.mail.properties.ssl:false}")
|
||||||
private boolean ssl;
|
private boolean ssl;
|
||||||
|
|
||||||
@Value("${spring.mail.properties.sender}")
|
@Value("${spring.mail.properties.sender}")
|
||||||
|
|||||||
@ -19,7 +19,6 @@ package org.maxkey;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
|
||||||
import org.maxkey.configuration.ApplicationConfig;
|
import org.maxkey.configuration.ApplicationConfig;
|
||||||
import org.maxkey.web.InitializeContext;
|
import org.maxkey.web.InitializeContext;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
@ -32,7 +31,6 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
|
|||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
@ComponentScan(basePackages = {
|
@ComponentScan(basePackages = {
|
||||||
"org.maxkey.MaxKeyMgtConfig",
|
"org.maxkey.MaxKeyMgtConfig",
|
||||||
"org.maxkey.MaxKeyMgtMvcConfig",
|
"org.maxkey.MaxKeyMgtMvcConfig",
|
||||||
@ -54,6 +52,7 @@ import org.springframework.context.annotation.ComponentScan;
|
|||||||
"org.maxkey.identity.rest"
|
"org.maxkey.identity.rest"
|
||||||
})
|
})
|
||||||
@MapperScan("org.maxkey.persistence.mapper,")
|
@MapperScan("org.maxkey.persistence.mapper,")
|
||||||
|
@SpringBootApplication
|
||||||
public class MaxKeyMgtApplication extends SpringBootServletInitializer {
|
public class MaxKeyMgtApplication extends SpringBootServletInitializer {
|
||||||
private static final Logger _logger = LoggerFactory.getLogger(MaxKeyMgtApplication.class);
|
private static final Logger _logger = LoggerFactory.getLogger(MaxKeyMgtApplication.class);
|
||||||
|
|
||||||
|
|||||||
@ -25,24 +25,25 @@ mybatis.type-aliases-package=org.maxkey.domain,org.maxkey.domain.apps,
|
|||||||
mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/mysql/*.xml
|
mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/mysql/*.xml
|
||||||
mybatis.table-column-escape=true
|
mybatis.table-column-escape=true
|
||||||
#redis
|
#redis
|
||||||
spring.redis.host=127.0.0.1
|
#spring.redis.host=127.0.0.1
|
||||||
spring.redis.port=6379
|
#spring.redis.port=6379
|
||||||
spring.redis.password=password
|
#spring.redis.password=password
|
||||||
spring.redis.timeout=10000
|
#spring.redis.timeout=10000
|
||||||
spring.redis.jedis.pool.max-wait=1000
|
#spring.redis.jedis.pool.max-wait=1000
|
||||||
spring.redis.jedis.pool.max-idle=200
|
#spring.redis.jedis.pool.max-idle=200
|
||||||
spring.redis.lettuce.pool.max-active=-1
|
#spring.redis.lettuce.pool.max-active=-1
|
||||||
spring.redis.lettuce.pool.min-idle=0
|
#spring.redis.lettuce.pool.min-idle=0
|
||||||
|
|
||||||
#mail
|
#mail
|
||||||
spring.mail.default-encoding=utf-8
|
#spring.mail.default-encoding=utf-8
|
||||||
spring.mail.host=smtp.163.com
|
#spring.mail.host=smtp.163.com
|
||||||
spring.mail.port=465
|
#spring.mail.port=465
|
||||||
spring.mail.username=maxkey@163.com
|
#spring.mail.username=maxkey@163.com
|
||||||
spring.mail.password=password
|
#spring.mail.password=password
|
||||||
spring.mail.protocol=smtp
|
#spring.mail.protocol=smtp
|
||||||
spring.mail.properties.ssl=true
|
#spring.mail.properties.ssl=true
|
||||||
spring.mail.properties.sender=maxkey@163.com
|
#spring.mail.properties.sender=maxkey@163.com
|
||||||
|
|
||||||
#freemarker
|
#freemarker
|
||||||
spring.freemarker.template-loader-path=classpath:/templates/views
|
spring.freemarker.template-loader-path=classpath:/templates/views
|
||||||
spring.freemarker.cache=false
|
spring.freemarker.cache=false
|
||||||
@ -91,4 +92,12 @@ spring.kafka.producer.buffer-memory = 33554432
|
|||||||
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
|
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
|
||||||
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
|
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
|
||||||
# \u81ea\u5b9a\u4e49\u5206\u533a\u5668
|
# \u81ea\u5b9a\u4e49\u5206\u533a\u5668
|
||||||
# spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
|
# spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
|
||||||
|
|
||||||
|
#management.server.port=9522
|
||||||
|
#management.server.servlet.context-path=/maxkey-mgt-actuate
|
||||||
|
#management.endpoints.enabled-by-default=false
|
||||||
|
management.security.enabled=false
|
||||||
|
#management.endpoints.jmx.exposure.include=health,info
|
||||||
|
management.endpoints.web.exposure.include=metrics,health,info,env,beans
|
||||||
|
|
||||||
|
|||||||
@ -39,24 +39,24 @@ mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/mysql/*.x
|
|||||||
mybatis.table-column-escape=true
|
mybatis.table-column-escape=true
|
||||||
|
|
||||||
#redis
|
#redis
|
||||||
spring.redis.host=127.0.0.1
|
#spring.redis.host=127.0.0.1
|
||||||
spring.redis.port=6379
|
#spring.redis.port=6379
|
||||||
spring.redis.password=password
|
#spring.redis.password=password
|
||||||
spring.redis.timeout=10000
|
#spring.redis.timeout=10000
|
||||||
spring.redis.jedis.pool.max-wait=1000
|
#spring.redis.jedis.pool.max-wait=1000
|
||||||
spring.redis.jedis.pool.max-idle=200
|
#spring.redis.jedis.pool.max-idle=200
|
||||||
spring.redis.lettuce.pool.max-active=-1
|
#spring.redis.lettuce.pool.max-active=-1
|
||||||
spring.redis.lettuce.pool.min-idle=0
|
#spring.redis.lettuce.pool.min-idle=0
|
||||||
|
|
||||||
#mail
|
#mail
|
||||||
spring.mail.default-encoding=utf-8
|
#spring.mail.default-encoding=utf-8
|
||||||
spring.mail.host=smtp.163.com
|
#spring.mail.host=smtp.163.com
|
||||||
spring.mail.port=465
|
#spring.mail.port=465
|
||||||
spring.mail.username=maxkey@163.com
|
#spring.mail.username=maxkey@163.com
|
||||||
spring.mail.password=password
|
#spring.mail.password=password
|
||||||
spring.mail.protocol=smtp
|
#spring.mail.protocol=smtp
|
||||||
spring.mail.properties.ssl=true
|
#spring.mail.properties.ssl=true
|
||||||
spring.mail.properties.sender=maxkey@163.com
|
#spring.mail.properties.sender=maxkey@163.com
|
||||||
spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
|
spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
|
||||||
spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2} minutes.
|
spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2} minutes.
|
||||||
|
|
||||||
@ -117,4 +117,9 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str
|
|||||||
maxkey.swagger.enable=true
|
maxkey.swagger.enable=true
|
||||||
maxkey.swagger.title=MaxKey\u5355\u70b9\u767b\u5f55\u8ba4\u8bc1\u7cfb\u7edfapi\u6587\u6863
|
maxkey.swagger.title=MaxKey\u5355\u70b9\u767b\u5f55\u8ba4\u8bc1\u7cfb\u7edfapi\u6587\u6863
|
||||||
maxkey.swagger.description=MaxKey\u5355\u70b9\u767b\u5f55\u8ba4\u8bc1\u7cfb\u7edfapi\u6587\u6863
|
maxkey.swagger.description=MaxKey\u5355\u70b9\u767b\u5f55\u8ba4\u8bc1\u7cfb\u7edfapi\u6587\u6863
|
||||||
maxkey.swagger.version=${application.formatted-version}
|
maxkey.swagger.version=${application.formatted-version}
|
||||||
|
|
||||||
|
management.security.enabled=false
|
||||||
|
#management.endpoints.jmx.exposure.include=health,info
|
||||||
|
management.endpoints.web.exposure.include=metrics,health,info,env
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user