Skip to content

Commit 4739225

Browse files
committed
add quorum queue option for the consumer
Signed-off-by: Aaqa Ishtyaq <[email protected]>
1 parent ebf2e16 commit 4739225

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)