NewConsumerGroup creates a new consumer group the given broker addresses and configuration.
(addrs []string, groupID string, config *Config)
| 114 | |
| 115 | // NewConsumerGroup creates a new consumer group the given broker addresses and configuration. |
| 116 | func NewConsumerGroup(addrs []string, groupID string, config *Config) (ConsumerGroup, error) { |
| 117 | client, err := NewClient(addrs, config) |
| 118 | if err != nil { |
| 119 | return nil, err |
| 120 | } |
| 121 | |
| 122 | c, err := newConsumerGroup(groupID, client) |
| 123 | if err != nil { |
| 124 | _ = client.Close() |
| 125 | } |
| 126 | return c, err |
| 127 | } |
| 128 | |
| 129 | // NewConsumerGroupFromClient creates a new consumer group using the given client. It is still |
| 130 | // necessary to call Close() on the underlying client when shutting down this consumer. |