public class ConfigServerBootstrapApplicationListener extends Object implements org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>, org.springframework.core.Ordered
spring.cloud.config.enabled
is
explicitly "true". It has to be "true" at the time this listener is fired, which means
before the bootstrap.yml
is parsed, which in turn means to you need
to launch the application with an existing primed Environment
(e.g. via System
properties or a SpringApplicationBuilder
). This is the same rule of precedence
as for anything else affecting the bootstrap process itself, e.g. setting
spring.cloud.bootstrap.name
to something other than "bootstrap".
N.B. a config server can always be an "embedded" config client (using its own config
repository as a property source) if you set
spring.cloud.config.server.bootstrap=true
in bootstrap.yml
.
This listener is only to prevent it from using HTTP to contact itself.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ORDER
Default order of the bootstrap application listener.
|
Constructor and Description |
---|
ConfigServerBootstrapApplicationListener() |
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
void |
onApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event) |
void |
setOrder(int order) |
public static final int DEFAULT_ORDER
public ConfigServerBootstrapApplicationListener()
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setOrder(int order)
public void onApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.