Browse Source

add quorum queue option for the consumer

Signed-off-by: Aaqa Ishtyaq <aaqaishtyaq@gmail.com>
pull/98/head
Aaqa Ishtyaq 3 years ago
parent
commit
4739225d6f
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      consumer_options.go

+ 11
- 0
consumer_options.go View File

@ -282,3 +282,14 @@ func WithConsumerOptionsQOSPrefetch(prefetchCount int) func(*ConsumerOptions) {
func WithConsumerOptionsQOSGlobal(options *ConsumerOptions) { func WithConsumerOptionsQOSGlobal(options *ConsumerOptions) {
options.QOSGlobal = true options.QOSGlobal = true
} }
// WithConsumerOptionsQueueQuorum sets the queue a quorum type, which means
// multiple nodes in the cluster will have the messages distributed amongst them
// for higher reliability
func WithConsumerOptionsQueueQuorum(options *ConsumerOptions) {
if options.QueueOptions.Args == nil {
options.QueueOptions.Args = Table{}
}
options.QueueOptions.Args["x-queue-type"] = "quorum"
}

Loading…
Cancel
Save