@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.529Z") @Stability(value=Stable) public enum DnsResponseType extends Enum<DnsResponseType>
Example:
// Example automatically generated from non-compiling source. May contain errors.
// A Virtual Node with a gRPC listener with a connection pool set
Mesh mesh;
VirtualNode node = VirtualNode.Builder.create(this, "node")
.mesh(mesh)
// DNS service discovery can optionally specify the DNS response type as either LOAD_BALANCER or ENDPOINTS.
// LOAD_BALANCER means that the DNS resolver returns a loadbalanced set of endpoints,
// whereas ENDPOINTS means that the DNS resolver is returning all the endpoints.
// By default, the response type is assumed to be LOAD_BALANCER
.serviceDiscovery(ServiceDiscovery.dns("node", DnsResponseType.ENDPOINTS))
.listeners(List.of(VirtualNodeListener.http(HttpVirtualNodeListenerOptions.builder()
.port(80)
.connectionPool(HttpConnectionPool.builder()
.maxConnections(100)
.maxPendingRequests(10)
.build())
.build())))
.build();
// A Virtual Gateway with a gRPC listener with a connection pool set
VirtualGateway gateway = VirtualGateway.Builder.create(this, "gateway")
.mesh(mesh)
.listeners(List.of(VirtualGatewayListener.grpc(GrpcGatewayListenerOptions.builder()
.port(8080)
.connectionPool(GrpcConnectionPool.builder()
.maxRequests(10)
.build())
.build())))
.virtualGatewayName("gateway")
.build();
| Enum Constant and Description |
|---|
ENDPOINTS
DNS resolver is returning all the endpoints.
|
LOAD_BALANCER
DNS resolver returns a loadbalanced set of endpoints and the traffic would be sent to the given endpoints.
|
| Modifier and Type | Method and Description |
|---|---|
static DnsResponseType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DnsResponseType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Stable) public static final DnsResponseType LOAD_BALANCER
It would not drain existing connections to other endpoints that are not part of this list.
@Stability(value=Stable) public static final DnsResponseType ENDPOINTS
This also means that if an endpoint is missing, it would drain the current connections to the missing endpoint.
public static DnsResponseType[] values()
for (DnsResponseType c : DnsResponseType.values()) System.out.println(c);
public static DnsResponseType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.