Documentation ¶
Index ¶
- func NewMultiMessageConsumer(config MultiMessageConsumerConfiguration) *multiMessageConsumer
- func NewSingleMessageConsumer(config SingleMessageConsumerConfiguration) *singleMessageConsumer
- func NewSqsClient(ctx context.Context, config SqsClientConfiguration) (sqsClient, error)
- func NewWorker(config Configuration) worker
- type Configuration
- type DeleterConfiguration
- type ErrorConfiguration
- type MultiMessageBufferConfiguration
- type MultiMessageConsumerConfiguration
- type SingleMessageConsumerConfiguration
- type SqsClientConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultiMessageConsumer ¶
func NewMultiMessageConsumer(config MultiMessageConsumerConfiguration) *multiMessageConsumer
func NewSingleMessageConsumer ¶
func NewSingleMessageConsumer(config SingleMessageConsumerConfiguration) *singleMessageConsumer
func NewSqsClient ¶
func NewSqsClient(ctx context.Context, config SqsClientConfiguration) (sqsClient, error)
func NewWorker ¶
func NewWorker(config Configuration) worker
Types ¶
type Configuration ¶
type Configuration struct { // A queue client Client client.Client // Number of Go routines that process the messages from the Queue. // The higher this value, the more Go routines are spawned to process the messages. // Using a high value can be useful when the Handler of the consumer perform slow I/O operations. // Default: 100. Concurrency int // Number of Go routines that retrieve messages from the Queue. // The higher this value, the more Go routines are spawned to read the messages from the // queue and provide them to the worker's consumers. // Using a high value can be useful when the network is slow or when consumers are quicker // than retrievers. // Default: 1. Retrievers int // The ErrorConfiguration. ErrorConfig ErrorConfiguration // The messages Consumer. Consumer consumer // Configuration for the deleter DeleterConfig DeleterConfiguration }
type DeleterConfiguration ¶
type ErrorConfiguration ¶
type ErrorConfiguration struct { // Number of errors that must occur in the Period before the worker stops. // Default: 3. Threshold int // Duration of the period for which, if the number of errors passes the Threshold, the worker stops. // Default: 120s. Period time.Duration // The error report function ReportFunc func(err error) }
The ErrorConfiguration defines a threshold for which the worker stops. If the number of errors occurred during the worker execution passes the given Threshold on the specified Period, the worker stops.
type MultiMessageBufferConfiguration ¶
type MultiMessageBufferConfiguration struct { // Max number of messages that the buffer can contain. // Default: 10. Size int // Time after which the buffer gets processed, no matter whether it is full or not. // This value MUST be smaller tha VisibilityTimeout in the // RetrieveMessageConfiguration + the maximum processing time of the handler. // If this is not set correctly, the same message could be processed multiple times. // Default: 1s. Timeout time.Duration }
The MultiMessageBufferConfiguration defines a buffer which is consumed by the worker when either the buffer is full or the timeout has passed since the first message got added.
type MultiMessageConsumerConfiguration ¶
type MultiMessageConsumerConfiguration struct { Handler multiMessageHandler BufferConfig MultiMessageBufferConfiguration }
type SingleMessageConsumerConfiguration ¶
type SingleMessageConsumerConfiguration struct {
Handler singleMessageHandler
}
type SqsClientConfiguration ¶
type SqsClientConfiguration struct { // The AWS Sqs Service Client Svc *awsSqs.Client // The AWS ReceiveMessageInput ReceiveMessageInput *awsSqs.ReceiveMessageInput // Defines the interval within which the message must be processed. // If empty, it tries to set the value from the ReceiveMessageInput's // VisibilityTimeout. // If ReceiveMessageInput's VisibilityTimeout is empty it retrieves the // default value set on the queue. This action will fail if the client // does not have the permission to retrieve the SQS queue's attributes. MessageCtxTimeout time.Duration }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.