prompt for replay policy in consumers
@@ -275,6 +275,7 @@ func (c *consumerCmd) sampleFreqFromString(s int) string {
func (c *consumerCmd) defaultConsumer() *api.ConsumerConfig {
return &api.ConsumerConfig{
AckPolicy: api.AckExplicit,
+ ReplayPolicy: api.ReplayInstant,
}
}
@@ -435,6 +436,16 @@ func (c *consumerCmd) prepareConfig() (cfg *api.ConsumerConfig, err error) {
kingpin.FatalIfError(err, "could not ask acknowledgement policy")
}
+ if c.replayPolicy == "" {
+ err = survey.AskOne(&survey.Select{
+ Message: "Replay policy",
+ Options: []string{"instant", "original"},
+ Default: "instant",
+ Help: "Messages can be replayed at the rate they arrived in or as fast as possible. Settable using --replay",
+ }, &c.replayPolicy)
+ kingpin.FatalIfError(err, "could not ask replay policy")
+ }
+
cfg.AckPolicy = c.ackPolicyFromString(c.ackPolicy)
if cfg.AckPolicy == api.AckNone {
cfg.MaxDeliver = -1
