Class EurekaUpdatingListenerBuilder
java.lang.Object
com.linecorp.armeria.client.AbstractClientOptionsBuilder
com.linecorp.armeria.client.AbstractWebClientBuilder
com.linecorp.armeria.server.eureka.EurekaUpdatingListenerBuilder
public final class EurekaUpdatingListenerBuilder
extends com.linecorp.armeria.client.AbstractWebClientBuilder
Builds a
EurekaUpdatingListener, which registers the server to Eureka.
Examples
EurekaUpdatingListener listener =
EurekaUpdatingListener.builder("eureka.com:8001/eureka/v2")
.instanceId("i-00000000")
.setHostname("armeria.service.1")
.ipAddr("192.168.10.10")
.vipAddress("armeria.service.com:8080");
.build();
ServerBuilder sb = Server.builder();
sb.serverListener(listener);
-
Method Summary
Modifier and TypeMethodDescriptionaddHeader(CharSequence name, Object value) addHeaders(Iterable<? extends Map.Entry<? extends CharSequence, ?>> headers) appGroupName(String appGroupName) Sets the group name of the application.Sets the name of the application.auth(com.linecorp.armeria.common.auth.AuthToken token) auth(com.linecorp.armeria.common.auth.BasicToken token) auth(com.linecorp.armeria.common.auth.OAuth1aToken token) auth(com.linecorp.armeria.common.auth.OAuth2Token token) build()Returns a newly-createdEurekaUpdatingListenerbased on the properties of this builder.contextCustomizer(Consumer<? super com.linecorp.armeria.client.ClientRequestContext> contextCustomizer) dataCenterMetadata(Map<String, String> dataCenterMetadata) Sets the metadata of the data center.dataCenterName(String dataCenterName) Sets the name of the data center.decorator(com.linecorp.armeria.client.DecoratingHttpClientFunction decorator) decorator(Function<? super com.linecorp.armeria.client.HttpClient, ? extends com.linecorp.armeria.client.HttpClient> decorator) endpointRemapper(Function<? super com.linecorp.armeria.client.Endpoint, ? extends com.linecorp.armeria.client.endpoint.EndpointGroup> endpointRemapper) factory(com.linecorp.armeria.client.ClientFactory factory) healthCheckUrl(String healthCheckUrl) Sets the health check URL.healthCheckUrlPath(String healthCheckUrlPath) Sets the health check path used to automatically createhealthCheckUrl(String)andsecureHealthCheckUrl(String).homePageUrl(String homePageUrl) Sets the home page URL.homePageUrlPath(String homePageUrlPath) Sets the home page URL path used to automatically createhomePageUrl(String).Sets the hostname.instanceId(String instanceId) Sets the ID of this instance.Sets the IP address.leaseDuration(Duration leaseDuration) Sets the lease duration.leaseDurationMillis(long leaseDurationMillis) Sets the lease duration in milliseconds.leaseDurationSeconds(int leaseDurationSeconds) Deprecated.maxResponseLength(long maxResponseLength) Sets the metadata.option(com.linecorp.armeria.client.ClientOption<T> option, T value) option(com.linecorp.armeria.client.ClientOptionValue<T> optionValue) options(com.linecorp.armeria.client.ClientOptions options) options(com.linecorp.armeria.client.ClientOptionValue<?>... options) port(int port) Sets the port used forSessionProtocol.HTTP.renewalInterval(Duration renewalInterval) Sets the interval between renewal.renewalIntervalMillis(long renewalIntervalMillis) Sets the interval between renewal in milliseconds.renewalIntervalSeconds(int renewalIntervalSeconds) Deprecated.requestAutoAbortDelay(Duration delay) requestAutoAbortDelayMillis(long delayMillis) requestIdGenerator(Supplier<com.linecorp.armeria.common.RequestId> requestIdGenerator) responseTimeout(Duration responseTimeout) responseTimeoutMillis(long responseTimeoutMillis) rpcDecorator(com.linecorp.armeria.client.DecoratingRpcClientFunction decorator) rpcDecorator(Function<? super com.linecorp.armeria.client.RpcClient, ? extends com.linecorp.armeria.client.RpcClient> decorator) secureHealthCheckUrl(String secureHealthCheckUrl) Sets the secure health check URL.securePort(int securePort) Sets the port used forSessionProtocol.HTTPS.secureVipAddress(String secureVipAddress) Sets the secure VIP address.setHeader(CharSequence name, Object value) setHeaders(Iterable<? extends Map.Entry<? extends CharSequence, ?>> headers) statusPageUrl(String statusPageUrl) Sets the status page URL.statusPageUrlPath(String statusPageUrlPath) Sets the status page URL path used to automatically createstatusPageUrl(String).successFunction(com.linecorp.armeria.common.SuccessFunction successFunction) vipAddress(String vipAddress) Sets the VIP address.writeTimeout(Duration writeTimeout) writeTimeoutMillis(long writeTimeoutMillis) Methods inherited from class com.linecorp.armeria.client.AbstractWebClientBuilder
buildWebClient, clientBuilderParamsMethods inherited from class com.linecorp.armeria.client.AbstractClientOptionsBuilder
buildOptions, buildOptions, contextHook, followRedirects, followRedirects
-
Method Details
-
renewalInterval
Sets the interval between renewal. 30 seconds is used by default and it's not recommended to modify this value. Eureka protocol stores this value in seconds internally, and thus this method will convert the given interval into seconds, rounding up its sub-second part. See renew. -
renewalIntervalSeconds
Deprecated.Sets the interval between renewal in seconds. 30 is used by default and it's not recommended to modify this value. See renew. -
renewalIntervalMillis
Sets the interval between renewal in milliseconds.30000(30 seconds) is used by default and it's not recommended to modify this value. Eureka protocol stores this value in seconds internally, and thus this method will convert the given interval into seconds, rounding up its sub-second part. See renew. -
leaseDuration
Sets the lease duration. 90 seconds is used by default and it's not recommended to modify this value. Eureka protocol stores this value in seconds internally, and thus this method will convert the given duration into seconds, rounding up its sub-second part. See renew. -
leaseDurationSeconds
Deprecated.Sets the lease duration in seconds. 90 is used by default and it's not recommended to modify this value. See renew. -
leaseDurationMillis
Sets the lease duration in milliseconds.90000(90 seconds) is used by default and it's not recommended to modify this value. Eureka protocol stores this value in seconds internally, and thus this method will convert the given duration into seconds, rounding up its sub-second part. See renew. -
hostname
Sets the hostname.Server.defaultHostname()is set if not specified. -
instanceId
Sets the ID of this instance. Derived fromhostname(String),appName(String)andport(int), if not specified. -
appName
Sets the name of the application.hostname(String)is set if not specified. -
appGroupName
Sets the group name of the application. -
ipAddr
Sets the IP address.SystemInfo.defaultNonLoopbackIpV4Address()is set if not specified. -
port
Sets the port used forSessionProtocol.HTTP. -
securePort
Sets the port used forSessionProtocol.HTTPS. -
vipAddress
Sets the VIP address.hostname(String)is set if not specified. -
secureVipAddress
Sets the secure VIP address.hostname(String)is set if not specified. -
homePageUrlPath
Sets the home page URL path used to automatically createhomePageUrl(String). -
homePageUrl
Sets the home page URL. -
statusPageUrlPath
Sets the status page URL path used to automatically createstatusPageUrl(String). -
statusPageUrl
Sets the status page URL. -
healthCheckUrlPath
Sets the health check path used to automatically createhealthCheckUrl(String)andsecureHealthCheckUrl(String). -
healthCheckUrl
Sets the health check URL. IfHealthCheckServiceis added toServerBuilderand Server.activePort(SessionProtocol.HTTP) returns an active port, then this URL will be automatically create using the information of theHealthCheckService. -
secureHealthCheckUrl
Sets the secure health check URL. IfHealthCheckServiceis added toServerBuilderand Server.activePort(SessionProtocol.HTTPS) returns an active port, then this URL will be automatically create using the information of theHealthCheckService. -
metadata
Sets the metadata. -
dataCenterName
Sets the name of the data center. -
dataCenterMetadata
Sets the metadata of the data center. -
build
Returns a newly-createdEurekaUpdatingListenerbased on the properties of this builder. Note that ifRetryingClientwas not set usingdecorator(DecoratingHttpClientFunction),RetryingClientis applied automatically using RetryingClient.newDecorator(RetryRule.failsafe(), 3). -
options
- Overrides:
optionsin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
options
public EurekaUpdatingListenerBuilder options(com.linecorp.armeria.client.ClientOptionValue<?>... options) - Overrides:
optionsin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
options
public EurekaUpdatingListenerBuilder options(Iterable<com.linecorp.armeria.client.ClientOptionValue<?>> options) - Overrides:
optionsin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
option
public <T> EurekaUpdatingListenerBuilder option(com.linecorp.armeria.client.ClientOption<T> option, T value) - Overrides:
optionin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
option
public <T> EurekaUpdatingListenerBuilder option(com.linecorp.armeria.client.ClientOptionValue<T> optionValue) - Overrides:
optionin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
factory
- Overrides:
factoryin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
writeTimeout
- Overrides:
writeTimeoutin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
writeTimeoutMillis
- Overrides:
writeTimeoutMillisin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
responseTimeout
- Overrides:
responseTimeoutin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
responseTimeoutMillis
- Overrides:
responseTimeoutMillisin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
maxResponseLength
- Overrides:
maxResponseLengthin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
requestAutoAbortDelay
- Overrides:
requestAutoAbortDelayin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
requestAutoAbortDelayMillis
- Overrides:
requestAutoAbortDelayMillisin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
requestIdGenerator
public EurekaUpdatingListenerBuilder requestIdGenerator(Supplier<com.linecorp.armeria.common.RequestId> requestIdGenerator) - Overrides:
requestIdGeneratorin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
successFunction
public EurekaUpdatingListenerBuilder successFunction(com.linecorp.armeria.common.SuccessFunction successFunction) - Overrides:
successFunctionin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
endpointRemapper
public EurekaUpdatingListenerBuilder endpointRemapper(Function<? super com.linecorp.armeria.client.Endpoint, ? extends com.linecorp.armeria.client.endpoint.EndpointGroup> endpointRemapper) - Overrides:
endpointRemapperin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
decorator
public EurekaUpdatingListenerBuilder decorator(Function<? super com.linecorp.armeria.client.HttpClient, ? extends com.linecorp.armeria.client.HttpClient> decorator) - Overrides:
decoratorin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
decorator
public EurekaUpdatingListenerBuilder decorator(com.linecorp.armeria.client.DecoratingHttpClientFunction decorator) - Overrides:
decoratorin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
rpcDecorator
public EurekaUpdatingListenerBuilder rpcDecorator(Function<? super com.linecorp.armeria.client.RpcClient, ? extends com.linecorp.armeria.client.RpcClient> decorator) - Overrides:
rpcDecoratorin classcom.linecorp.armeria.client.AbstractWebClientBuilder
-
rpcDecorator
public EurekaUpdatingListenerBuilder rpcDecorator(com.linecorp.armeria.client.DecoratingRpcClientFunction decorator) - Overrides:
rpcDecoratorin classcom.linecorp.armeria.client.AbstractWebClientBuilder
-
clearDecorators
- Overrides:
clearDecoratorsin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
addHeader
- Overrides:
addHeaderin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
addHeaders
public EurekaUpdatingListenerBuilder addHeaders(Iterable<? extends Map.Entry<? extends CharSequence, ?>> headers) - Overrides:
addHeadersin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
setHeader
- Overrides:
setHeaderin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
setHeaders
public EurekaUpdatingListenerBuilder setHeaders(Iterable<? extends Map.Entry<? extends CharSequence, ?>> headers) - Overrides:
setHeadersin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
auth
- Overrides:
authin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
auth
- Overrides:
authin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
auth
- Overrides:
authin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
auth
- Overrides:
authin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
contextCustomizer
public EurekaUpdatingListenerBuilder contextCustomizer(Consumer<? super com.linecorp.armeria.client.ClientRequestContext> contextCustomizer) - Overrides:
contextCustomizerin classcom.linecorp.armeria.client.AbstractClientOptionsBuilder
-
leaseDurationMillis(long).