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 Fluvio
connect()
Connect to a Fluvio cluster and return aFluvio
object on success.final PartitionConsumer
Create aPartitionConsumer
that consumes records from the specified topic and partition.void
delete()
protected void
finalize()
final TopicProducer
Create aTopicProducer
which produces records to the specified topic.
-
Method Details
-
connect
Connect to a Fluvio cluster and return aFluvio
object on success.- Throws:
Exception
-
consumer
Create aPartitionConsumer
that consumes records from the specified topic and partition.- Throws:
Exception
-
producer
Create aTopicProducer
which produces records to the specified topic.- Throws:
Exception
-
delete
public void delete() -
finalize
-