Skip to content

Instantly share code, notes, and snippets.

@rishabh-gupta2
Created March 30, 2021 12:01
Show Gist options
  • Save rishabh-gupta2/2d87eb3e80fc10407f3d8e3efd0ee051 to your computer and use it in GitHub Desktop.
Save rishabh-gupta2/2d87eb3e80fc10407f3d8e3efd0ee051 to your computer and use it in GitHub Desktop.
Outbox Config
// Config holds configs for outboxer.
type Config struct {
// ProcessorPoolSize is the number of processor goroutines
// which will Process outboxed jobs.
ProcessorPoolSize int
// JobProcessingTimeoutMs is the maximum time a job is expected to take
// time to process. After which it will be picked again for processing.
JobProcessingTimeoutMs int32
// MaxAttempts is the max number of times a failed job
// will be attempted for processing. In case MaxAttempts is exhausted,
// manual intervention will be needed for these jobs.
MaxAttempts int
// BackoffPolicy holds config for re-attempt backoff
// of failed outboxed jobs.
BackoffPolicy ExpBackoffPolicy
// FailedJobFetchBatchSize is the number of failed jobs
// read from the store for re-attempt.
FailedJobFetchBatchSize int32
// PendingJobFetchBatchSize is the number of pending jobs
// read from the store for processing.
PendingJobFetchBatchSize int32
// WaitTimeMsAfterEmptyRead is the time for which
// fetcher will wait before making the next read from the store,
// if there were no jobs read or database error.
WaitTimeMsAfterEmptyRead int64
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment