Class Fluvio
The Fluvio Java client for interacting with Fluvio streams from Java.
The Fluvio class does not provide a public constructor, instead it provides a static function that first connects to the target cluster and then returns a Fluvio object, representing a successfully-opened connection. If Fluvio fails to connect to a cluster, an exception will be thrown instead.
Fluvio fluvio = new Fluvio();
The cluster that the client connects to is determined by the active profile configured by the Fluvio CLI. Make sure you have followed the getting started guide and used the CLI to successfully connect to a running cluster, either on Fluvio Cloud or running locally.
Once a Fluvio object is created, it may be used to obtain a TopicProducer
or a PartitionConsumer, which may be used to send and receive records,
respectively.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Fluvioconnect()Connect to a Fluvio cluster and return aFluvioobject on success.final PartitionConsumerCreate aPartitionConsumerthat consumes records from the specified topic and partition.voiddelete()protected voidfinalize()final TopicProducerCreate aTopicProducerwhich produces records to the specified topic.
-
Method Details
-
connect
Connect to a Fluvio cluster and return aFluvioobject on success.- Throws:
Exception
-
consumer
Create aPartitionConsumerthat consumes records from the specified topic and partition.- Throws:
Exception
-
producer
Create aTopicProducerwhich produces records to the specified topic.- Throws:
Exception
-
delete
public void delete() -
finalize
-