rabbitmq / rabbitmq-stream-go-client

A client library for RabbitMQ streams
MIT License
170 stars 20 forks source link

Smart Consumer for V2 #244

Open ablease opened 1 year ago

ablease commented 1 year ago

Ideal Features

Description

Expanding on the V1 consumer, while addressing some issues highlighted in this issue #241. Keep the design close to Producer v2 for a more streamlined user experience. For example, the Consumer Options struct contains only optional params

Consumer Options

// ConsumerOpts handles optional parameters only
type ConsumerOpts struct {
    client             *Client
    ConsumerName       string
    streamName         string
    autocommit         bool
    autoCommitStrategy *AutoCommitStrategy
    Offset             OffsetSpecification
        Filter
    CRCCheck           bool
    initialCredits     int16
        sinlgeActiveConsumer bool
        reference string
}

// func (c *Consumer) CreateConsumer(stream string, opts ConsumerOpts) *Consumer {}

Single Active Consumer is created via the singleActiveConsumer bool and reference string in ConsumerOpts