add ability to fail probes and fatal on broker errors
All checks were successful
test / test (push) Successful in 3m12s
All checks were successful
test / test (push) Successful in 3m12s
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
11
options.go
11
options.go
@@ -72,6 +72,12 @@ func SubscribeOptions(opts ...kgo.Opt) broker.SubscribeOption {
|
||||
}
|
||||
}
|
||||
|
||||
type fatalOnErrorKey struct{}
|
||||
|
||||
func FatalOnError(b bool) broker.Option {
|
||||
return broker.SetOption(fatalOnErrorKey{}, b)
|
||||
}
|
||||
|
||||
type clientIDKey struct{}
|
||||
|
||||
func ClientID(id string) broker.Option {
|
||||
@@ -98,6 +104,11 @@ func SubscribeMaxInFlight(n int) broker.SubscribeOption {
|
||||
return broker.SetSubscribeOption(subscribeMaxInflightKey{}, n)
|
||||
}
|
||||
|
||||
// SubscribeMaxInFlight max queued messages
|
||||
func SubscribeFatalOnError(b bool) broker.SubscribeOption {
|
||||
return broker.SetSubscribeOption(fatalOnErrorKey{}, b)
|
||||
}
|
||||
|
||||
type publishPromiseKey struct{}
|
||||
|
||||
// PublishPromise set the kafka promise func for Produce
|
||||
|
Reference in New Issue
Block a user