Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
schbrain-parent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
schbrain-parent
Commits
4a0a7061
Commit
4a0a7061
authored
Oct 26, 2023
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spring-boot-admin
parent
20adb552
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
117 additions
and
56 deletions
+117
-56
commons/common-util/src/main/java/com/schbrain/common/util/IpAddressHolder.java
...c/main/java/com/schbrain/common/util/IpAddressHolder.java
+6
-34
pom.xml
pom.xml
+11
-0
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/JSONLoggingInitializer.java
...ramework/autoconfigure/logger/JSONLoggingInitializer.java
+1
-4
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/LoggingConfigLoadedEventListener.java
...ure/logger/listener/LoggingConfigLoadedEventListener.java
+4
-10
starters/xxl-job-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/xxl/properties/XxlJobProperties.java
...mework/autoconfigure/xxl/properties/XxlJobProperties.java
+2
-2
support/schbrain-spring-support/pom.xml
support/schbrain-spring-support/pom.xml
+10
-2
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/admin/AdminApplicationFactory.java
...amework/support/spring/admin/AdminApplicationFactory.java
+38
-0
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/admin/SpringBootAdminFeatureAutoConfiguration.java
...spring/admin/SpringBootAdminFeatureAutoConfiguration.java
+35
-0
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/env/DefaultPropertiesEnvironmentPostProcessor.java
...spring/env/DefaultPropertiesEnvironmentPostProcessor.java
+9
-4
support/schbrain-spring-support/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
...ingframework.boot.autoconfigure.AutoConfiguration.imports
+1
-0
No files found.
commons/common-util/src/main/java/com/schbrain/common/util/
HostInfo
Holder.java
→
commons/common-util/src/main/java/com/schbrain/common/util/
IpAddress
Holder.java
View file @
4a0a7061
package
com.schbrain.common.util
;
package
com.schbrain.common.util
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.*
;
import
java.net.*
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
java.util.Optional
;
/**
/**
* @author liaozan
* @author liaozan
* @since 2021/11/19
* @since 2021/11/19
*/
*/
@Slf4j
@Slf4j
public
class
HostInfo
Holder
{
public
class
IpAddress
Holder
{
private
static
final
HostInfo
HOST_INFO
=
findFirstNonLoopBackHostInfo
();
private
static
final
String
POD_IP
=
System
.
getenv
(
"POD_IP"
);
private
static
final
String
LOCAL_IP
=
Optional
.
ofNullable
(
findFirstNonLoopBackAddress
()).
map
(
InetAddress:
:
getHostAddress
).
orElse
(
"127.0.0.1"
);
public
static
HostInfo
getHostInfo
()
{
public
static
String
getIpAddress
()
{
return
HOST_INFO
;
return
POD_IP
==
null
?
LOCAL_IP
:
POD_IP
;
}
private
static
HostInfo
findFirstNonLoopBackHostInfo
()
{
InetAddress
address
=
findFirstNonLoopBackAddress
();
if
(
address
!=
null
)
{
return
convertAddress
(
address
);
}
log
.
warn
(
"Cannot find first non-loopBack address, fallback to localhost"
);
HostInfo
hostInfo
=
new
HostInfo
();
hostInfo
.
setHostname
(
"localhost"
);
hostInfo
.
setIpAddress
(
"127.0.0.1"
);
return
hostInfo
;
}
}
private
static
InetAddress
findFirstNonLoopBackAddress
()
{
private
static
InetAddress
findFirstNonLoopBackAddress
()
{
...
@@ -72,21 +61,4 @@ public class HostInfoHolder {
...
@@ -72,21 +61,4 @@ public class HostInfoHolder {
return
null
;
return
null
;
}
}
private
static
HostInfo
convertAddress
(
final
InetAddress
address
)
{
HostInfo
hostInfo
=
new
HostInfo
();
String
hostname
=
address
.
getHostName
();
hostInfo
.
setHostname
(
hostname
);
hostInfo
.
setIpAddress
(
address
.
getHostAddress
());
return
hostInfo
;
}
@Data
public
static
class
HostInfo
{
private
String
ipAddress
;
private
String
hostname
;
}
}
}
pom.xml
View file @
4a0a7061
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
<pagehelper.version>
5.3.3
</pagehelper.version>
<pagehelper.version>
5.3.3
</pagehelper.version>
<redisson.version>
3.18.0
</redisson.version>
<redisson.version>
3.18.0
</redisson.version>
<skywalking-tooklit.version>
9.0.0
</skywalking-tooklit.version>
<skywalking-tooklit.version>
9.0.0
</skywalking-tooklit.version>
<spring-boot-admin.version>
2.7.11
</spring-boot-admin.version>
<vavr.version>
0.10.4
</vavr.version>
<vavr.version>
0.10.4
</vavr.version>
<xxl-job.version>
2.0.2
</xxl-job.version>
<xxl-job.version>
2.0.2
</xxl-job.version>
<zookeeper.version>
3.9.1
</zookeeper.version>
<zookeeper.version>
3.9.1
</zookeeper.version>
...
@@ -422,6 +423,16 @@
...
@@ -422,6 +423,16 @@
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
<version>
${skywalking-tooklit.version}
</version>
<version>
${skywalking-tooklit.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-server
</artifactId>
<version>
${spring-boot-admin.version}
</version>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
<version>
${spring-boot-admin.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
io.vavr
</groupId>
<groupId>
io.vavr
</groupId>
<artifactId>
vavr
</artifactId>
<artifactId>
vavr
</artifactId>
...
...
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/JSONLoggingInitializer.java
View file @
4a0a7061
...
@@ -8,7 +8,6 @@ import ch.qos.logback.core.rolling.RollingFileAppender;
...
@@ -8,7 +8,6 @@ import ch.qos.logback.core.rolling.RollingFileAppender;
import
ch.qos.logback.core.rolling.TimeBasedRollingPolicy
;
import
ch.qos.logback.core.rolling.TimeBasedRollingPolicy
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
com.schbrain.common.util.*
;
import
com.schbrain.common.util.*
;
import
com.schbrain.common.util.HostInfoHolder.HostInfo
;
import
com.schbrain.framework.autoconfigure.logger.logstash.EnhancedLogstashEncoder
;
import
com.schbrain.framework.autoconfigure.logger.logstash.EnhancedLogstashEncoder
;
import
com.schbrain.framework.autoconfigure.logger.properties.LoggingProperties
;
import
com.schbrain.framework.autoconfigure.logger.properties.LoggingProperties
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -126,11 +125,9 @@ public class JSONLoggingInitializer {
...
@@ -126,11 +125,9 @@ public class JSONLoggingInitializer {
}
}
private
String
getCustomFields
()
{
private
String
getCustomFields
()
{
HostInfo
hostInfo
=
HostInfoHolder
.
getHostInfo
();
JSONObject
customFields
=
new
JSONObject
();
JSONObject
customFields
=
new
JSONObject
();
customFields
.
set
(
"appName"
,
applicationName
);
customFields
.
set
(
"appName"
,
applicationName
);
customFields
.
set
(
"hostName"
,
hostInfo
.
getHostname
());
customFields
.
set
(
"podIp"
,
IpAddressHolder
.
getIpAddress
());
customFields
.
set
(
"podIp"
,
hostInfo
.
getIpAddress
());
return
customFields
.
toString
();
return
customFields
.
toString
();
}
}
...
...
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/LoggingConfigLoadedEventListener.java
View file @
4a0a7061
...
@@ -5,9 +5,7 @@ import cn.hutool.system.SystemUtil;
...
@@ -5,9 +5,7 @@ import cn.hutool.system.SystemUtil;
import
com.ctrip.framework.apollo.ConfigFile
;
import
com.ctrip.framework.apollo.ConfigFile
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
com.google.common.collect.Maps
;
import
com.schbrain.common.util.IpAddressHolder
;
import
com.schbrain.common.util.HostInfoHolder
;
import
com.schbrain.common.util.HostInfoHolder.HostInfo
;
import
com.schbrain.framework.autoconfigure.apollo.event.ConfigLoadedEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.ConfigLoadedEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.ConfigLoadedEventListenerAdaptor
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.ConfigLoadedEventListenerAdaptor
;
import
com.schbrain.framework.autoconfigure.logger.JSONLoggingInitializer
;
import
com.schbrain.framework.autoconfigure.logger.JSONLoggingInitializer
;
...
@@ -33,7 +31,7 @@ public class LoggingConfigLoadedEventListener extends ConfigLoadedEventListenerA
...
@@ -33,7 +31,7 @@ public class LoggingConfigLoadedEventListener extends ConfigLoadedEventListenerA
@Override
@Override
protected
void
onConfigLoaded
(
ConfigLoadedEvent
event
,
LoggingProperties
properties
)
{
protected
void
onConfigLoaded
(
ConfigLoadedEvent
event
,
LoggingProperties
properties
)
{
event
.
getPropertySource
().
addProperties
(
build
HostInfo
Properties
());
event
.
getPropertySource
().
addProperties
(
build
IpAddress
Properties
());
configLoggingFileLocation
(
event
.
getEnvironment
(),
properties
.
getLogConfigNamespace
());
configLoggingFileLocation
(
event
.
getEnvironment
(),
properties
.
getLogConfigNamespace
());
}
}
...
@@ -45,12 +43,8 @@ public class LoggingConfigLoadedEventListener extends ConfigLoadedEventListenerA
...
@@ -45,12 +43,8 @@ public class LoggingConfigLoadedEventListener extends ConfigLoadedEventListenerA
/**
/**
* hostInfo properties, for logging pattern, used in logback-spring.xml
* hostInfo properties, for logging pattern, used in logback-spring.xml
*/
*/
private
Map
<
String
,
Object
>
buildHostInfoProperties
()
{
private
Map
<
String
,
Object
>
buildIpAddressProperties
()
{
HostInfo
hostInfo
=
HostInfoHolder
.
getHostInfo
();
return
Map
.
of
(
"application.ipAddress"
,
IpAddressHolder
.
getIpAddress
());
Map
<
String
,
Object
>
properties
=
Maps
.
newHashMapWithExpectedSize
(
2
);
properties
.
put
(
"application.hostname"
,
hostInfo
.
getHostname
());
properties
.
put
(
"application.ipAddress"
,
hostInfo
.
getIpAddress
());
return
properties
;
}
}
/**
/**
...
...
starters/xxl-job-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/xxl/properties/XxlJobProperties.java
View file @
4a0a7061
package
com.schbrain.framework.autoconfigure.xxl.properties
;
package
com.schbrain.framework.autoconfigure.xxl.properties
;
import
com.schbrain.common.util.
HostInfo
Holder
;
import
com.schbrain.common.util.
IpAddress
Holder
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
...
@@ -15,7 +15,7 @@ public class XxlJobProperties implements ConfigurableProperties {
...
@@ -15,7 +15,7 @@ public class XxlJobProperties implements ConfigurableProperties {
private
String
adminAddresses
;
private
String
adminAddresses
;
private
String
ip
=
HostInfoHolder
.
getHostInfo
()
.
getIpAddress
();
private
String
ip
=
IpAddressHolder
.
getIpAddress
();
private
int
port
=
-
1
;
private
int
port
=
-
1
;
...
...
support/schbrain-spring-support/pom.xml
View file @
4a0a7061
...
@@ -20,16 +20,24 @@
...
@@ -20,16 +20,24 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-a
ctuator
</artifactId>
<artifactId>
spring-boot-starter-a
op
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-properties-migrator
</artifactId>
<artifactId>
spring-boot-properties-migrator
</artifactId>
...
...
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/admin/AdminApplicationFactory.java
0 → 100644
View file @
4a0a7061
package
com.schbrain.framework.support.spring.admin
;
import
com.schbrain.common.util.IpAddressHolder
;
import
de.codecentric.boot.admin.client.config.InstanceProperties
;
import
de.codecentric.boot.admin.client.registration.ServletApplicationFactory
;
import
de.codecentric.boot.admin.client.registration.metadata.MetadataContributor
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints
;
import
org.springframework.boot.autoconfigure.web.ServerProperties
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
;
import
javax.servlet.ServletContext
;
/**
* @author liaozan
* @since 2023/10/26
*/
public
class
AdminApplicationFactory
extends
ServletApplicationFactory
{
public
AdminApplicationFactory
(
InstanceProperties
instance
,
ManagementServerProperties
management
,
ServerProperties
server
,
ServletContext
servletContext
,
PathMappedEndpoints
pathMappedEndpoints
,
WebEndpointProperties
webEndpoint
,
MetadataContributor
metadataContributor
,
DispatcherServletPath
dispatcherServletPath
)
{
super
(
instance
,
management
,
server
,
servletContext
,
pathMappedEndpoints
,
webEndpoint
,
metadataContributor
,
dispatcherServletPath
);
}
@Override
protected
String
getServiceHost
()
{
return
IpAddressHolder
.
getIpAddress
();
}
@Override
protected
String
getManagementHost
()
{
return
IpAddressHolder
.
getIpAddress
();
}
}
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/admin/SpringBootAdminFeatureAutoConfiguration.java
0 → 100644
View file @
4a0a7061
package
com.schbrain.framework.support.spring.admin
;
import
de.codecentric.boot.admin.client.config.InstanceProperties
;
import
de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration
;
import
de.codecentric.boot.admin.client.registration.ApplicationFactory
;
import
de.codecentric.boot.admin.client.registration.metadata.MetadataContributor
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties
;
import
org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints
;
import
org.springframework.boot.autoconfigure.AutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform
;
import
org.springframework.boot.autoconfigure.web.ServerProperties
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
;
import
org.springframework.boot.cloud.CloudPlatform
;
import
org.springframework.context.annotation.Bean
;
import
javax.servlet.ServletContext
;
/**
* @author liaozan
* @since 2023/10/26
*/
@AutoConfiguration
(
before
=
SpringBootAdminClientAutoConfiguration
.
class
)
@ConditionalOnCloudPlatform
(
CloudPlatform
.
KUBERNETES
)
public
class
SpringBootAdminFeatureAutoConfiguration
{
@Bean
public
ApplicationFactory
applicationFactory
(
InstanceProperties
instance
,
ManagementServerProperties
management
,
ServerProperties
server
,
ServletContext
servletContext
,
PathMappedEndpoints
pathMappedEndpoints
,
WebEndpointProperties
webEndpoint
,
MetadataContributor
metadataContributor
,
DispatcherServletPath
dispatcherServletPath
)
{
return
new
AdminApplicationFactory
(
instance
,
management
,
server
,
servletContext
,
pathMappedEndpoints
,
webEndpoint
,
metadataContributor
,
dispatcherServletPath
);
}
}
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/env/DefaultPropertiesEnvironmentPostProcessor.java
View file @
4a0a7061
...
@@ -32,13 +32,17 @@ public class DefaultPropertiesEnvironmentPostProcessor extends LoggerAwareEnviro
...
@@ -32,13 +32,17 @@ public class DefaultPropertiesEnvironmentPostProcessor extends LoggerAwareEnviro
private
static
final
String
SPRING_PROFILE_ACTIVE
=
"spring.profiles.active"
;
private
static
final
String
SPRING_PROFILE_ACTIVE
=
"spring.profiles.active"
;
private
final
Map
<
String
,
Object
>
defaultProperties
=
new
LinkedHashMap
<>();
public
DefaultPropertiesEnvironmentPostProcessor
(
DeferredLogFactory
logFactory
,
ConfigurableBootstrapContext
bootstrapContext
)
{
public
DefaultPropertiesEnvironmentPostProcessor
(
DeferredLogFactory
logFactory
,
ConfigurableBootstrapContext
bootstrapContext
)
{
super
(
logFactory
,
bootstrapContext
);
super
(
logFactory
,
bootstrapContext
);
}
}
@Override
@Override
public
void
postProcessEnvironment
(
ConfigurableEnvironment
environment
,
SpringApplication
application
)
{
public
void
postProcessEnvironment
(
ConfigurableEnvironment
environment
,
SpringApplication
application
)
{
Map
<
String
,
Object
>
defaultProperties
=
new
LinkedHashMap
<>();
// active profile
configureActiveProfileIfPresent
(
environment
,
defaultProperties
);
environment
.
setDefaultProfiles
(
EnvUtils
.
DEVELOPMENT
);
// management
// management
defaultProperties
.
put
(
"management.trace.http.enabled"
,
false
);
defaultProperties
.
put
(
"management.trace.http.enabled"
,
false
);
defaultProperties
.
put
(
"management.endpoints.web.exposure.include"
,
"*"
);
defaultProperties
.
put
(
"management.endpoints.web.exposure.include"
,
"*"
);
...
@@ -46,6 +50,7 @@ public class DefaultPropertiesEnvironmentPostProcessor extends LoggerAwareEnviro
...
@@ -46,6 +50,7 @@ public class DefaultPropertiesEnvironmentPostProcessor extends LoggerAwareEnviro
defaultProperties
.
put
(
"management.endpoint.health.show-details"
,
Show
.
ALWAYS
.
name
());
defaultProperties
.
put
(
"management.endpoint.health.show-details"
,
Show
.
ALWAYS
.
name
());
defaultProperties
.
put
(
"management.endpoint.health.show-components"
,
Show
.
ALWAYS
.
name
());
defaultProperties
.
put
(
"management.endpoint.health.show-components"
,
Show
.
ALWAYS
.
name
());
defaultProperties
.
put
(
"management.info.git.mode"
,
Mode
.
FULL
.
name
());
defaultProperties
.
put
(
"management.info.git.mode"
,
Mode
.
FULL
.
name
());
defaultProperties
.
put
(
"management.info.env.enabled"
,
true
);
defaultProperties
.
put
(
"management.server.port"
,
PortUtils
.
findAvailablePort
(
1024
));
defaultProperties
.
put
(
"management.server.port"
,
PortUtils
.
findAvailablePort
(
1024
));
// servlet
// servlet
defaultProperties
.
put
(
"spring.servlet.multipart.max-file-size"
,
DataSize
.
ofBytes
(-
1
).
toString
());
defaultProperties
.
put
(
"spring.servlet.multipart.max-file-size"
,
DataSize
.
ofBytes
(-
1
).
toString
());
...
@@ -64,9 +69,9 @@ public class DefaultPropertiesEnvironmentPostProcessor extends LoggerAwareEnviro
...
@@ -64,9 +69,9 @@ public class DefaultPropertiesEnvironmentPostProcessor extends LoggerAwareEnviro
defaultProperties
.
put
(
"spring.main.allow-circular-references"
,
true
);
defaultProperties
.
put
(
"spring.main.allow-circular-references"
,
true
);
defaultProperties
.
put
(
"spring.main.banner-mode"
,
Banner
.
Mode
.
OFF
.
name
());
defaultProperties
.
put
(
"spring.main.banner-mode"
,
Banner
.
Mode
.
OFF
.
name
());
defaultProperties
.
put
(
"server.shutdown"
,
Shutdown
.
GRACEFUL
.
name
());
defaultProperties
.
put
(
"server.shutdown"
,
Shutdown
.
GRACEFUL
.
name
());
// active profile
if
(
EnvUtils
.
runningOnCloudPlatform
(
environment
))
{
configureActiveProfileIfPresent
(
environment
,
defaultProperties
);
defaultProperties
.
put
(
"spring.boot.admin.client.url"
,
"http://spring-boot-admin-server.devops:8019"
);
environment
.
setDefaultProfiles
(
EnvUtils
.
DEVELOPMENT
);
}
DefaultPropertiesPropertySource
.
addOrMerge
(
defaultProperties
,
environment
.
getPropertySources
());
DefaultPropertiesPropertySource
.
addOrMerge
(
defaultProperties
,
environment
.
getPropertySources
());
}
}
...
...
support/schbrain-spring-support/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
View file @
4a0a7061
com.schbrain.framework.support.spring.admin.SpringBootAdminFeatureAutoConfiguration
com.schbrain.framework.support.spring.elasticsearch.ElasticsearchFeatureAutoConfiguration
com.schbrain.framework.support.spring.elasticsearch.ElasticsearchFeatureAutoConfiguration
com.schbrain.framework.support.spring.redisson.RedissonFeatureAutoConfiguration
com.schbrain.framework.support.spring.redisson.RedissonFeatureAutoConfiguration
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment