WithRetryAttempts sets the retry number of attempts when ErrNoResponders is encountered. Defaults to 2
(num int)
| 687 | // WithRetryAttempts sets the retry number of attempts when ErrNoResponders is |
| 688 | // encountered. Defaults to 2 |
| 689 | func WithRetryAttempts(num int) PublishOpt { |
| 690 | return func(opts *pubOpts) error { |
| 691 | if num < 0 { |
| 692 | return fmt.Errorf("%w: retry attempts cannot be negative", ErrInvalidOption) |
| 693 | } |
| 694 | opts.retryAttempts = num |
| 695 | return nil |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | // WithStallWait sets the max wait when the producer becomes stall producing |
| 700 | // messages. If a publish call is blocked for this long, ErrTooManyStalledMsgs |