Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface { // Retrieves data for the topics subscribed. // On each poll, consumer will try to use the last consumed offset as the starting offset and fetch sequentially. Poll() ConsumerPollResult // Gets a point-in-time value of the number of brokers in the cluster BrokersLength() int // Explicitly reports that the data polled has been consumed to all brokers in the cluster. // // When exiting the application cleanly, it's usually recommended to invoke ManualCommit() once before Close() to // make sure other consumer of the group can continue where this consumer left off. // // When polling in loop from a consumer, it's usually not necessary to call ManualCommit() per each pool // as the broker will automatically commit the consumer offsets periodically. ManualCommit() ConsumerCommitResult // Closes the consumer // // A Consumer instance is designed to be long-lived. Close() should only be called when no more messages // should be read in the application. Close() }
Represents a PolarStreams client that reads records from a cluster.
func NewConsumer ¶
NewConsumer creates a new Consumer, discovers the PolarStreams cluster and subscribes to the topic provided.
func NewConsumerWithOpts ¶
NewConsumer creates a new Consumer with the provided options.
It discovers the PolarStreams cluster and subscribes to the topics provided.
type Producer ¶
type Producer interface { // Sends a message to a topic Send(topic string, message io.Reader, partitionKey string) error // Gets a point-in-time value of the number of brokers in the cluster BrokersLength() int // Closes the producer // // A Producer instance is designed to be long-lived. Close() should only be called when no more messages are // expected to be published in the cluster. Close() }
Represents a PolarStreams client that publishes records in a cluster.
func NewProducer ¶
NewProducer creates a new Producer and discovers the PolarStreams cluster.
A Producer instance is designed to be long-lived and it should be reused across the application.
func NewProducerWithOpts ¶
func NewProducerWithOpts(serviceUrl string, options types.ProducerOptions) (Producer, error)
NewProducer creates a new Producer with the provided options and discovers the PolarStreams cluster.
A Producer instance is designed to be long-lived and it should be reused across the application.