Skip to content

Commit a476fb9

Browse files
committed
allow on-prem consumers to turn on health checks if required
1 parent c85b894 commit a476fb9

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

mainboilerplate/runconsumer/run_consumer.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,14 @@ type Config interface {
9292
type BaseConfig struct {
9393
Consumer struct {
9494
mbp.ServiceConfig
95-
Limit uint32 `long:"limit" env:"LIMIT" default:"32" description:"Maximum number of Shards this consumer process will allocate"`
96-
MaxHotStandbys uint32 `long:"max-hot-standbys" env:"MAX_HOT_STANDBYS" default:"3" description:"Maximum effective hot standbys of any one shard, which upper-bounds its stated hot-standbys."`
97-
WatchDelay time.Duration `long:"watch-delay" env:"WATCH_DELAY" default:"30ms" description:"Delay applied to the application of watched Etcd events. Larger values amortize the processing of fast-changing Etcd keys."`
98-
SkipSignedURLs bool `long:"skip-signed-urls" env:"SKIP_SIGNED_URLS" description:"When a signed URL is received, use fragment info instead to retrieve data with auth header. This is useful when clients do not wish/require the signing."`
99-
AuthKeys string `long:"auth-keys" env:"AUTH_KEYS" description:"Whitespace or comma separated, base64-encoded keys used to sign (first key) and verify (all keys) Authorization tokens." json:"-"`
100-
AWSAccessKeyIDPath string `long:"aws-access-key-id-path" env:"AWS_ACCESS_KEY_ID_PATH" default:"" description:"file path to the aws access key id secret"`
101-
AWSSecretAccessKeyPath string `long:"aws-secret-access-key-path" env:"AWS_SECRET_ACCESS_KEY_PATH" default:"" description:"file path to the aws secret access key secret"`
95+
Limit uint32 `long:"limit" env:"LIMIT" default:"32" description:"Maximum number of Shards this consumer process will allocate"`
96+
MaxHotStandbys uint32 `long:"max-hot-standbys" env:"MAX_HOT_STANDBYS" default:"3" description:"Maximum effective hot standbys of any one shard, which upper-bounds its stated hot-standbys."`
97+
WatchDelay time.Duration `long:"watch-delay" env:"WATCH_DELAY" default:"30ms" description:"Delay applied to the application of watched Etcd events. Larger values amortize the processing of fast-changing Etcd keys."`
98+
SkipSignedURLs bool `long:"skip-signed-urls" env:"SKIP_SIGNED_URLS" description:"When a signed URL is received, use fragment info instead to retrieve data with auth header. This is useful when clients do not wish/require the signing."`
99+
AuthKeys string `long:"auth-keys" env:"AUTH_KEYS" description:"Whitespace or comma separated, base64-encoded keys used to sign (first key) and verify (all keys) Authorization tokens." json:"-"`
100+
AWSAccessKeyIDPath string `long:"aws-access-key-id-path" env:"AWS_ACCESS_KEY_ID_PATH" default:"" description:"file path to the aws access key id secret"`
101+
AWSSecretAccessKeyPath string `long:"aws-secret-access-key-path" env:"AWS_SECRET_ACCESS_KEY_PATH" default:"" description:"file path to the aws secret access key secret"`
102+
ForceStoreHealthCheckToHealthy bool `long:"force-store-health-check-to-healthy" env:"FORCE_STORE_HEALTH_CHECK_TO_HEALTHY" default:"true" description:"Force the health check of fragment stores to healthy"`
102103
} `group:"Consumer" namespace:"consumer" env-namespace:"CONSUMER"`
103104

104105
Broker struct {
@@ -196,6 +197,11 @@ func (sc Cmd) Execute(args []string) error {
196197
stores.DisableSignedUrls = true
197198
}
198199

200+
if !bc.Consumer.ForceStoreHealthCheckToHealthy {
201+
// this defaults to true, so we only need to set it to false if the user explicitly wants to disable it
202+
stores.ForceStoreHealthCheckToHealthy = bc.Consumer.ForceStoreHealthCheckToHealthy
203+
}
204+
199205
// Load AWS credentials from file paths if both are configured.
200206
if bc.Consumer.AWSAccessKeyIDPath != "" && bc.Consumer.AWSSecretAccessKeyPath != "" {
201207
accessKeyID, err := os.ReadFile(bc.Consumer.AWSAccessKeyIDPath)

0 commit comments

Comments
 (0)