Shared queue distribution of messages
This commit is contained in:
@@ -9,6 +9,10 @@ type SubscribeOptions struct {
|
||||
AutoAck bool
|
||||
// NumHandlers defaults to 1
|
||||
NumHandlers int
|
||||
// Subscribers with the same queue name
|
||||
// will create a shared subscription where each
|
||||
// receives a subset of messages.
|
||||
Queue string
|
||||
}
|
||||
|
||||
type Option func(*Options)
|
||||
@@ -33,6 +37,12 @@ func NumHandlers(i int) SubscribeOption {
|
||||
}
|
||||
}
|
||||
|
||||
func QueueName(name string) SubscribeOption {
|
||||
return func(o *SubscribeOptions) {
|
||||
o.Queue = name
|
||||
}
|
||||
}
|
||||
|
||||
func newSubscribeOptions(opts ...SubscribeOption) SubscribeOptions {
|
||||
opt := SubscribeOptions{
|
||||
AutoAck: true,
|
||||
|
Reference in New Issue
Block a user