NewConsumer creates a new consumer using the given broker addresses and configuration.
(addrs []string, config *Config)
| 110 | |
| 111 | // NewConsumer creates a new consumer using the given broker addresses and configuration. |
| 112 | func NewConsumer(addrs []string, config *Config) (Consumer, error) { |
| 113 | client, err := NewClient(addrs, config) |
| 114 | if err != nil { |
| 115 | return nil, err |
| 116 | } |
| 117 | return newConsumer(client) |
| 118 | } |
| 119 | |
| 120 | // NewConsumerFromClient creates a new consumer using the given client. It is still |
| 121 | // necessary to call Close() on the underlying client when shutting down this consumer. |