@@ -42,11 +42,12 @@ type acker interface {
42
42
43
43
type consumer struct {
44
44
sync.Mutex
45
- topic string
46
- client * client
47
- options ConsumerOptions
48
- consumers []* partitionConsumer
49
- consumerName string
45
+ topic string
46
+ client * client
47
+ options ConsumerOptions
48
+ consumers []* partitionConsumer
49
+ consumerName string
50
+ disableForceTopicCreation bool
50
51
51
52
// channel used to deliver message to clients
52
53
messageCh chan ConsumerMessage
@@ -123,17 +124,18 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
123
124
}
124
125
125
126
func newInternalConsumer (client * client , options ConsumerOptions , topic string ,
126
- messageCh chan ConsumerMessage , dlq * dlqRouter ) (* consumer , error ) {
127
+ messageCh chan ConsumerMessage , dlq * dlqRouter , disableForceTopicCreation bool ) (* consumer , error ) {
127
128
128
129
consumer := & consumer {
129
- topic : topic ,
130
- client : client ,
131
- options : options ,
132
- messageCh : messageCh ,
133
- closeCh : make (chan struct {}),
134
- errorCh : make (chan error ),
135
- dlq : dlq ,
136
- log : log .WithField ("topic" , topic ),
130
+ topic : topic ,
131
+ client : client ,
132
+ options : options ,
133
+ disableForceTopicCreation : disableForceTopicCreation ,
134
+ messageCh : messageCh ,
135
+ closeCh : make (chan struct {}),
136
+ errorCh : make (chan error ),
137
+ dlq : dlq ,
138
+ log : log .WithField ("topic" , topic ),
137
139
}
138
140
139
141
if options .Name != "" {
@@ -275,7 +277,7 @@ func (c *consumer) internalTopicSubscribeToPartitions() error {
275
277
276
278
func topicSubscribe (client * client , options ConsumerOptions , topic string ,
277
279
messageCh chan ConsumerMessage , dlqRouter * dlqRouter ) (Consumer , error ) {
278
- return newInternalConsumer (client , options , topic , messageCh , dlqRouter )
280
+ return newInternalConsumer (client , options , topic , messageCh , dlqRouter , false )
279
281
}
280
282
281
283
func (c * consumer ) Subscription () string {
0 commit comments