@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:48.554Z") public enum DnsResponseType extends java.lang.Enum<DnsResponseType>
Example:
// 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(java.lang.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.
|
public static final DnsResponseType LOAD_BALANCER
It would not drain existing connections to other endpoints that are not part of this list.
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(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null