public interface Environment extends AutoCloseable
Environment is the main entry point to a node or a cluster of nodes. Producer
and Consumer instances are created from an Environment instance. An Environment can also create and delete streams.
Applications are supposed to use a single Environment instance to interact with a
cluster.
Use builder() to configure and create an Environment instance.
Environment instances are expected to be thread-safe.
EnvironmentBuilder| Modifier and Type | Method and Description |
|---|---|
static EnvironmentBuilder |
builder()
Create a builder to configure and create an
Environment |
void |
close()
Close the environment and its resources.
|
ConsumerBuilder |
consumerBuilder()
Create a
ConsumerBuilder to configure and create a Consumer |
void |
deleteStream(String stream)
Delete a stream
|
void |
deleteSuperStream(String superStream)
Delete a super stream.
|
ProducerBuilder |
producerBuilder()
Create a
ProducerBuilder to configure and create a Producer. |
StreamStats |
queryStreamStats(String stream)
Query statistics on a stream.
|
StreamCreator |
streamCreator()
Return a
StreamCreator to configure and create a stream. |
boolean |
streamExists(String stream)
Return whether a stream exists or not.
|
static EnvironmentBuilder builder()
EnvironmentEnvironmentBuilderStreamCreator streamCreator()
StreamCreator to configure and create a stream.StreamCreatorvoid deleteStream(String stream)
stream - the stream to deletevoid deleteSuperStream(String superStream)
Requires RabbitMQ 3.13.0 or more.
superStream - the super stream to deleteStreamStats queryStreamStats(String stream)
Requires RabbitMQ 3.11 or more.
stream - the stream to get statistics fromUnsupportedOperationException - if the broker does not support this commandboolean streamExists(String stream)
stream - the stream to check the existenceStreamException - if response code is different from Constants.RESPONSE_CODE_OK
or Constants.RESPONSE_CODE_STREAM_DOES_NOT_EXISTProducerBuilder producerBuilder()
ProducerBuilder to configure and create a Producer.ProducerBuilderConsumerBuilder consumerBuilder()
ConsumerBuilder to configure and create a ConsumerConsumerBuildervoid close()
close in interface AutoCloseableCopyright © 2024 Broadcom Inc. and/or its subsidiaries. All rights reserved.