public class StreamEnvironmentBuilder extends Object implements EnvironmentBuilder
EnvironmentBuilder.TlsConfiguration| Constructor and Description |
|---|
StreamEnvironmentBuilder() |
| Modifier and Type | Method and Description |
|---|---|
EnvironmentBuilder |
addressResolver(AddressResolver addressResolver)
An
AddressResolver to potentially change resolved node address to connect to. |
Environment |
build()
Create the
Environment instance. |
EnvironmentBuilder |
byteBufAllocator(io.netty.buffer.ByteBufAllocator byteBufAllocator) |
StreamEnvironmentBuilder |
channelCustomizer(ChannelCustomizer channelCustomizer)
An extension point to customize Netty's
Channels used for connection. |
StreamEnvironmentBuilder |
chunkChecksum(ChunkChecksum chunkChecksum)
The checksum strategy used for chunk checksum.
|
StreamEnvironmentBuilder |
clientProperties(Map<String,String> clientProperties)
Custom client properties to add to default client properties.
|
StreamEnvironmentBuilder |
clientProperty(String key,
String value)
Add a custom client properties to default client properties.
|
StreamEnvironmentBuilder |
codec(Codec codec)
The AMQP 1.0 codec used to encode and decode AMQP 1.0 messages.
|
EnvironmentBuilder |
compressionCodecFactory(CompressionCodecFactory compressionCodecFactory) |
StreamEnvironmentBuilder |
credentialsProvider(CredentialsProvider credentialsProvider)
The
CredentialsProvider to use. |
EnvironmentBuilder |
eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
The Netty
EventLoopGroup instance to use. |
StreamEnvironmentBuilder |
host(String host)
The host to connect to.
|
EnvironmentBuilder |
lazyInitialization(boolean lazy)
To delay the connection opening until necessary.
|
EnvironmentBuilder |
maxConsumersByConnection(int maxConsumersByConnection)
The maximum number of consumers allocated to a single connection.
|
EnvironmentBuilder |
maxProducersByConnection(int maxProducersByConnection)
The maximum number of producers allocated to a single connection.
|
EnvironmentBuilder |
maxTrackingConsumersByConnection(int maxTrackingConsumersByConnection)
The maximum number of tracking consumers allocated to a single connection.
|
StreamEnvironmentBuilder |
metricsCollector(MetricsCollector metricsCollector)
Set up a
MetricsCollector. |
StreamEnvironmentBuilder |
password(String password)
The password to use.
|
StreamEnvironmentBuilder |
port(int port)
The port to use to connect.
|
EnvironmentBuilder |
recoveryBackOffDelayPolicy(BackOffDelayPolicy recoveryBackOffDelayPolicy)
The
BackOffDelayPolicy to use for connection recovery. |
StreamEnvironmentBuilder |
requestedHeartbeat(Duration requestedHeartbeat)
The hearbeat to request.
|
StreamEnvironmentBuilder |
requestedMaxFrameSize(int requestedMaxFrameSize)
The maximum frame size to request.
|
EnvironmentBuilder |
rpcTimeout(Duration timeout)
Timeout for RPC calls.
|
StreamEnvironmentBuilder |
saslConfiguration(SaslConfiguration saslConfiguration)
The SASL configuration to use.
|
EnvironmentBuilder |
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Set the
ScheduledExecutorService used to:
Schedule producers batch sending
Handle connection recovery
Handle topology update
|
EnvironmentBuilder.TlsConfiguration |
tls()
Enable and configure TLS.
|
EnvironmentBuilder |
topologyUpdateBackOffDelayPolicy(BackOffDelayPolicy topologyUpdateBackOffDelayPolicy)
The
BackOffDelayPolicy to use for topology recovery. |
StreamEnvironmentBuilder |
uri(String uriString)
The URI of a node to connect to.
|
StreamEnvironmentBuilder |
uris(List<String> uris)
A list of URIs of nodes of the same cluster to use to connect to.
|
StreamEnvironmentBuilder |
username(String username)
The username to use.
|
StreamEnvironmentBuilder |
virtualHost(String virtualHost)
The virtual host to connect to.
|
public StreamEnvironmentBuilder uri(String uriString)
EnvironmentBuilderURI must be of the form rabbitmq-stream://guest:guest@localhost:5552/%2f.
uri in interface EnvironmentBuilderpublic StreamEnvironmentBuilder uris(List<String> uris)
EnvironmentBuilderURIs must be of the form rabbitmq-stream://guest:guest@localhost:5552/%2f.
uris in interface EnvironmentBuilderpublic StreamEnvironmentBuilder host(String host)
EnvironmentBuilderhost in interface EnvironmentBuilderpublic StreamEnvironmentBuilder port(int port)
EnvironmentBuilderport in interface EnvironmentBuilderpublic StreamEnvironmentBuilder codec(Codec codec)
EnvironmentBuildercodec in interface EnvironmentBuilderpublic EnvironmentBuilder compressionCodecFactory(CompressionCodecFactory compressionCodecFactory)
compressionCodecFactory in interface EnvironmentBuilderpublic EnvironmentBuilder eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
EnvironmentBuilderEventLoopGroup instance to use.
The environment uses its own instance by default. It is the developer's responsibility to
close the EventLoopGroup they provide.
eventLoopGroup in interface EnvironmentBuilderpublic EnvironmentBuilder byteBufAllocator(io.netty.buffer.ByteBufAllocator byteBufAllocator)
byteBufAllocator in interface EnvironmentBuilderpublic EnvironmentBuilder rpcTimeout(Duration timeout)
EnvironmentBuilderDefault is 10 seconds.
rpcTimeout in interface EnvironmentBuilderpublic StreamEnvironmentBuilder saslConfiguration(SaslConfiguration saslConfiguration)
EnvironmentBuildersaslConfiguration in interface EnvironmentBuilderEnvironmentBuilder.credentialsProvider(CredentialsProvider)public StreamEnvironmentBuilder credentialsProvider(CredentialsProvider credentialsProvider)
EnvironmentBuilderCredentialsProvider to use.credentialsProvider in interface EnvironmentBuilderEnvironmentBuilder.saslConfiguration(SaslConfiguration)public StreamEnvironmentBuilder username(String username)
EnvironmentBuilderusername in interface EnvironmentBuilderpublic StreamEnvironmentBuilder password(String password)
EnvironmentBuilderpassword in interface EnvironmentBuilderpublic StreamEnvironmentBuilder virtualHost(String virtualHost)
EnvironmentBuildervirtualHost in interface EnvironmentBuilderpublic StreamEnvironmentBuilder requestedHeartbeat(Duration requestedHeartbeat)
EnvironmentBuilderDefault is 60 seconds.
requestedHeartbeat in interface EnvironmentBuilderpublic StreamEnvironmentBuilder requestedMaxFrameSize(int requestedMaxFrameSize)
EnvironmentBuilderDefault is 1048576.
requestedMaxFrameSize in interface EnvironmentBuilderpublic StreamEnvironmentBuilder channelCustomizer(ChannelCustomizer channelCustomizer)
EnvironmentBuilderChannels used for connection.channelCustomizer in interface EnvironmentBuilderpublic StreamEnvironmentBuilder chunkChecksum(ChunkChecksum chunkChecksum)
EnvironmentBuilderThe default is CRC32 based on JDK implementation.
chunkChecksum in interface EnvironmentBuilderpublic StreamEnvironmentBuilder clientProperties(Map<String,String> clientProperties)
EnvironmentBuilderclientProperties in interface EnvironmentBuilderpublic StreamEnvironmentBuilder clientProperty(String key, String value)
EnvironmentBuilderclientProperty in interface EnvironmentBuilderpublic StreamEnvironmentBuilder metricsCollector(MetricsCollector metricsCollector)
EnvironmentBuilderMetricsCollector.metricsCollector in interface EnvironmentBuilderpublic EnvironmentBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
EnvironmentBuilderScheduledExecutorService used to:
scheduledExecutorService in interface EnvironmentBuilderscheduledExecutorService - the service to usepublic EnvironmentBuilder recoveryBackOffDelayPolicy(BackOffDelayPolicy recoveryBackOffDelayPolicy)
EnvironmentBuilderBackOffDelayPolicy to use for connection recovery.
The default is a fixed delay of 5 seconds.
recoveryBackOffDelayPolicy in interface EnvironmentBuilderpublic EnvironmentBuilder topologyUpdateBackOffDelayPolicy(BackOffDelayPolicy topologyUpdateBackOffDelayPolicy)
EnvironmentBuilderBackOffDelayPolicy to use for topology recovery.
Topology recovery can kick in when streams leaders and replicas move from nodes to nodes in the cluster.
The default is a fixed delay of 5 seconds.
topologyUpdateBackOffDelayPolicy in interface EnvironmentBuilderpublic EnvironmentBuilder addressResolver(AddressResolver addressResolver)
EnvironmentBuilderAddressResolver to potentially change resolved node address to connect to.
Applications can use this abstraction to make sure connection attempts ignore metadata hints and always go to a single point like a load balancer.
addressResolver in interface EnvironmentBuilderpublic EnvironmentBuilder maxProducersByConnection(int maxProducersByConnection)
EnvironmentBuilderDefault is 256, which is the maximum value.
maxProducersByConnection in interface EnvironmentBuilderpublic EnvironmentBuilder maxTrackingConsumersByConnection(int maxTrackingConsumersByConnection)
EnvironmentBuilderDefault is 50, which is the maximum value.
maxTrackingConsumersByConnection in interface EnvironmentBuilderpublic EnvironmentBuilder maxConsumersByConnection(int maxConsumersByConnection)
EnvironmentBuilderDefault is 256, which is the maximum value.
maxConsumersByConnection in interface EnvironmentBuilderpublic EnvironmentBuilder lazyInitialization(boolean lazy)
EnvironmentBuilderNo connection will be open before it is necessary (for stream management or producer/consumer creation).
Default is false.
lazyInitialization in interface EnvironmentBuilderpublic EnvironmentBuilder.TlsConfiguration tls()
EnvironmentBuildertls in interface EnvironmentBuilderpublic Environment build()
EnvironmentBuilderEnvironment instance.build in interface EnvironmentBuilderCopyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.