Documentation ¶
Index ¶
- func NewBatchConsumer(config BatchConsumerConfiguration) *batchConsumer
- func NewMessageConsumer(config MessageConsumerConfiguration) *messageConsumer
- func NewSqsClient(ctx context.Context, config SqsClientConfiguration) (sqsClient, error)
- func NewWorker(config Configuration) worker
- type BatchConsumerBufferConfiguration
- type BatchConsumerConfiguration
- type BatchResponse
- type Configuration
- type DeleterConfiguration
- type ErrorConfiguration
- type Message
- type MessageConsumerConfiguration
- type SqsClientConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBatchConsumer ¶ added in v0.0.8
func NewBatchConsumer(config BatchConsumerConfiguration) *batchConsumer
func NewMessageConsumer ¶ added in v0.0.8
func NewMessageConsumer(config MessageConsumerConfiguration) *messageConsumer
func NewSqsClient ¶ added in v0.0.6
func NewSqsClient(ctx context.Context, config SqsClientConfiguration) (sqsClient, error)
func NewWorker ¶
func NewWorker(config Configuration) worker
Types ¶
type BatchConsumerBufferConfiguration ¶ added in v0.0.8
type BatchConsumerBufferConfiguration 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 BatchConsumerBufferConfiguration 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 BatchConsumerConfiguration ¶ added in v0.0.8
type BatchConsumerConfiguration struct { Handler batchHandler BufferConfig BatchConsumerBufferConfiguration }
type BatchResponse ¶ added in v0.0.8
type BatchResponse struct {
FailedMessagesId []interface{}
}
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, returns a boolean value to decide whether the error counts towards to threshold ReportFunc func(err error) bool }
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 MessageConsumerConfiguration ¶ added in v0.0.8
type MessageConsumerConfiguration struct {
Handler messageHandler
}
type SqsClientConfiguration ¶ added in v0.0.6
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.