feat: more consumer option config (#363)
Closes #362
diff --git a/consumer/option.go b/consumer/option.go
index 6e7f4d2..5b585a3 100644
--- a/consumer/option.go
+++ b/consumer/option.go
@@ -233,3 +233,33 @@
opts.Strategy = strategy
}
}
+
+func WithPullBatchSize(batchSize int32) Option {
+ return func(options *consumerOptions) {
+ options.PullBatchSize = batchSize
+ }
+}
+
+func WithRebalanceLockInterval(interval time.Duration) Option {
+ return func(options *consumerOptions) {
+ options.RebalanceLockInterval = interval
+ }
+}
+
+func WithAutoCommit(auto bool) Option {
+ return func(options *consumerOptions) {
+ options.AutoCommit = auto
+ }
+}
+
+func WithSuspendCurrentQueueTimeMillis(suspendT time.Duration) Option {
+ return func(options *consumerOptions) {
+ options.SuspendCurrentQueueTimeMillis = suspendT
+ }
+}
+
+func WithPullInterval(interval time.Duration) Option {
+ return func(options *consumerOptions) {
+ options.PullInterval = interval
+ }
+}