func WithMaxReconsumeTimes(times int32) Option {
	return func(opts *consumerOptions) {
		opts.MaxReconsumeTimes = times
	}
}
WithMaxReconsumeTimes set MaxReconsumeTimes of options, if message reconsume greater than MaxReconsumeTimes, it will
be sent to retry or dlq topic. more info reference by examples/consumer/retry.
package consumer
import (
	"time"
	"github.com/apache/rocketmq-client-go/v2/internal"
	"github.com/apache/rocketmq-client-go/v2/primitive"
)
type consumerOptions struct {
	internal.ClientOptions
	ConsumeTimestamp string
	ConsumerPullTimeout time.Duration
	ConsumeConcurrentlyMaxSpan int
	PullThresholdForQueue int64
	PullThresholdSizeForQueue int
	PullThresholdForTopic int
	PullThresholdSizeForTopic int
	PullInterval time.Duration
	ConsumeMessageBatchMaxSize int
	PullBatchSize int32
	PostSubscriptionWhenPull bool
	MaxReconsumeTimes int32
	SuspendCurrentQueueTimeMillis time.Duration
	ConsumeTimeout time.Duration
	ConsumerModel  MessageModel
	Strategy       AllocateStrategy
	ConsumeOrderly bool
	FromWhere      ConsumeFromWhere
	Interceptors []primitive.Interceptor
	MaxTimeConsumeContinuously time.Duration
	AutoCommit            bool
	RebalanceLockInterval time.Duration
	Resolver primitive.NsResolver
}
func defaultPushConsumerOptions() consumerOptions {
	opts := consumerOptions{
		ClientOptions:              internal.DefaultClientOptions(),
		Strategy:                   AllocateByAveragely,
		MaxTimeConsumeContinuously: time.Duration(60 * time.Second),
		RebalanceLockInterval:      20 * time.Second,
		MaxReconsumeTimes:          -1,
		ConsumerModel:              Clustering,
		AutoCommit:                 true,
		Resolver:                   primitive.NewHttpResolver("DEFAULT"),
	}
	opts.ClientOptions.GroupName = "DEFAULT_CONSUMER"
	return opts
}
type Option func(*consumerOptions)
func defaultPullConsumerOptions() consumerOptions {
	opts := consumerOptions{
		ClientOptions: internal.DefaultClientOptions(),
		Resolver:      primitive.NewHttpResolver("DEFAULT"),
	}
	opts.ClientOptions.GroupName = "DEFAULT_CONSUMER"
	return opts
}
func WithConsumerModel(m MessageModel) Option {
	return func(options *consumerOptions) {
		options.ConsumerModel = m
	}
}
func WithConsumeFromWhere(w ConsumeFromWhere) Option {
	return func(options *consumerOptions) {
		options.FromWhere = w
	}
}
func WithConsumerOrder(order bool) Option {
	return func(options *consumerOptions) {
		options.ConsumeOrderly = order
	}
}
func WithConsumeMessageBatchMaxSize(consumeMessageBatchMaxSize int) Option {
	return func(options *consumerOptions) {
		options.ConsumeMessageBatchMaxSize = consumeMessageBatchMaxSize
	}
}
func WithInterceptor(fs ...primitive.Interceptor) Option {
	return func(options *consumerOptions) {
		options.Interceptors = append(options.Interceptors, fs...)
	}
}
func WithGroupName(group string) Option {
	return func(opts *consumerOptions) {
		if group == "" {
			return
		}
		opts.GroupName = group
	}
}
func WithInstance(name string) Option {
	return func(options *consumerOptions) {
		options.InstanceName = name
	}
}
func WithNamespace(namespace string) Option {
	return func(opts *consumerOptions) {
		opts.Namespace = namespace
	}
}
func WithVIPChannel(enable bool) Option {
	return func(opts *consumerOptions) {
		opts.VIPChannelEnabled = enable
	}
}
func WithRetry(retries int) Option {
	return func(opts *consumerOptions) {
		opts.RetryTimes = retries
	}
}
func WithCredentials(c primitive.Credentials) Option {
	return func(options *consumerOptions) {
		options.ClientOptions.Credentials = c
	}
}