Skip to content

Commit 32bd696

Browse files
authored
Merge pull request #98 from aaqaishtyaq/queue-quorum
add quorum queue option for the consumer
2 parents 9f51e28 + 4739225 commit 32bd696

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

consumer_options.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,14 @@ func WithConsumerOptionsQOSPrefetch(prefetchCount int) func(*ConsumerOptions) {
282282
func WithConsumerOptionsQOSGlobal(options *ConsumerOptions) {
283283
options.QOSGlobal = true
284284
}
285+
286+
// WithConsumerOptionsQueueQuorum sets the queue a quorum type, which means
287+
// multiple nodes in the cluster will have the messages distributed amongst them
288+
// for higher reliability
289+
func WithConsumerOptionsQueueQuorum(options *ConsumerOptions) {
290+
if options.QueueOptions.Args == nil {
291+
options.QueueOptions.Args = Table{}
292+
}
293+
294+
options.QueueOptions.Args["x-queue-type"] = "quorum"
295+
}

0 commit comments

Comments
 (0)