Documentation ¶
Overview ¶
Package messageprocessor is a generated GoMock package.
Index ¶
- type Chain
- type Decorator
- type MaxRetriesExceededError
- type MessageProcessor
- type MessageProcessorError
- type MockMessageProcessor
- type MockMessageProcessorError
- type MockMessageProcessorErrorMockRecorder
- type MockMessageProcessorMockRecorder
- type RetryableMessageProcessor
- type RetryableMessageProcessorComponent
- type RetryableMessageProcessorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain []Decorator
Chain is an ordered collection of Decorators.
func (Chain) Apply ¶
func (c Chain) Apply(base MessageProcessor) MessageProcessor
Apply wraps the given RoundTripper with the Decorator chain.
type Decorator ¶
type Decorator func(MessageProcessor) MessageProcessor
Decorator is a named type for any function that takes a RoundTripper and returns a RoundTripper.
type MaxRetriesExceededError ¶ added in v0.1.0
MaxRetriesExceededError implements MessageProcessorError and is used to indicate to upstream application/ decorators that retries have been attempted and exhausted
func (MaxRetriesExceededError) Error ¶ added in v0.1.0
func (t MaxRetriesExceededError) Error() string
func (MaxRetriesExceededError) IsRetryable ¶ added in v0.1.0
func (t MaxRetriesExceededError) IsRetryable() bool
IsRetryable indicates whether or not the JiraClient Error that was returned should be retried
func (MaxRetriesExceededError) RetryAfter ¶ added in v0.1.0
func (t MaxRetriesExceededError) RetryAfter() int
RetryAfter is not relevant in context of MaxRetriesExceededError as IsRetryable is set to false
type MessageProcessor ¶
type MessageProcessor interface {
ProcessMessage(ctx context.Context, record *kinesis.Record) MessageProcessorError
}
MessageProcessor processes a consumed message. Implementors are responsible for unmarshalling the data
type MessageProcessorError ¶ added in v0.2.0
MessageProcessorError represents an error that can be used to indicate to the consumer that an error should be retried
type MockMessageProcessor ¶ added in v0.1.0
type MockMessageProcessor struct {
// contains filtered or unexported fields
}
MockMessageProcessor is a mock of MessageProcessor interface.
func NewMockMessageProcessor ¶ added in v0.1.0
func NewMockMessageProcessor(ctrl *gomock.Controller) *MockMessageProcessor
NewMockMessageProcessor creates a new mock instance.
func (*MockMessageProcessor) EXPECT ¶ added in v0.1.0
func (m *MockMessageProcessor) EXPECT() *MockMessageProcessorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMessageProcessor) ProcessMessage ¶ added in v0.1.0
func (m *MockMessageProcessor) ProcessMessage(ctx context.Context, record *kinesis.Record) MessageProcessorError
ProcessMessage mocks base method.
type MockMessageProcessorError ¶ added in v0.2.0
type MockMessageProcessorError struct {
// contains filtered or unexported fields
}
MockMessageProcessorError is a mock of MessageProcessorError interface.
func NewMockMessageProcessorError ¶ added in v0.2.0
func NewMockMessageProcessorError(ctrl *gomock.Controller) *MockMessageProcessorError
NewMockMessageProcessorError creates a new mock instance.
func (*MockMessageProcessorError) EXPECT ¶ added in v0.2.0
func (m *MockMessageProcessorError) EXPECT() *MockMessageProcessorErrorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMessageProcessorError) Error ¶ added in v0.2.0
func (m *MockMessageProcessorError) Error() string
Error mocks base method.
func (*MockMessageProcessorError) IsRetryable ¶ added in v0.2.0
func (m *MockMessageProcessorError) IsRetryable() bool
IsRetryable mocks base method.
func (*MockMessageProcessorError) RetryAfter ¶ added in v0.2.0
func (m *MockMessageProcessorError) RetryAfter() int
RetryAfter mocks base method.
type MockMessageProcessorErrorMockRecorder ¶ added in v0.2.0
type MockMessageProcessorErrorMockRecorder struct {
// contains filtered or unexported fields
}
MockMessageProcessorErrorMockRecorder is the mock recorder for MockMessageProcessorError.
func (*MockMessageProcessorErrorMockRecorder) Error ¶ added in v0.2.0
func (mr *MockMessageProcessorErrorMockRecorder) Error() *gomock.Call
Error indicates an expected call of Error.
func (*MockMessageProcessorErrorMockRecorder) IsRetryable ¶ added in v0.2.0
func (mr *MockMessageProcessorErrorMockRecorder) IsRetryable() *gomock.Call
IsRetryable indicates an expected call of IsRetryable.
func (*MockMessageProcessorErrorMockRecorder) RetryAfter ¶ added in v0.2.0
func (mr *MockMessageProcessorErrorMockRecorder) RetryAfter() *gomock.Call
RetryAfter indicates an expected call of RetryAfter.
type MockMessageProcessorMockRecorder ¶ added in v0.1.0
type MockMessageProcessorMockRecorder struct {
// contains filtered or unexported fields
}
MockMessageProcessorMockRecorder is the mock recorder for MockMessageProcessor.
func (*MockMessageProcessorMockRecorder) ProcessMessage ¶ added in v0.1.0
func (mr *MockMessageProcessorMockRecorder) ProcessMessage(ctx, record interface{}) *gomock.Call
ProcessMessage indicates an expected call of ProcessMessage.
type RetryableMessageProcessor ¶ added in v0.1.0
type RetryableMessageProcessor struct {
// contains filtered or unexported fields
}
RetryableMessageProcessor is a `MessageProcessor` decorator that re-attempts processing of messages 'maxAttempts' number of times in case of failures 'maxAttempts' is a configurable parameter which can be set by consumer of this lib Exponential backoff has been implemented as a retry mechanism
func (*RetryableMessageProcessor) ProcessMessage ¶ added in v0.1.0
func (t *RetryableMessageProcessor) ProcessMessage(ctx context.Context, record *kinesis.Record) MessageProcessorError
ProcessMessage invokes the wrapped `MessageProcessor`. Attempts retries using exponential backoff if underlying 'MessageProcessor' returns an error. If 'maxAttempts' are exceeded without successful processing, it emits a stat indicating the same
type RetryableMessageProcessorComponent ¶ added in v0.3.0
type RetryableMessageProcessorComponent struct{}
RetryableMessageProcessorComponent implements the settings.Component interface.
func NewComponent ¶ added in v0.3.0
func NewComponent() *RetryableMessageProcessorComponent
NewComponent populates default values.
func (*RetryableMessageProcessorComponent) New ¶ added in v0.3.0
func (c *RetryableMessageProcessorComponent) New(_ context.Context, conf *RetryableMessageProcessorConfig) (func(MessageProcessor) MessageProcessor, error)
func (*RetryableMessageProcessorComponent) Settings ¶ added in v0.3.0
func (*RetryableMessageProcessorComponent) Settings() *RetryableMessageProcessorConfig
Settings generates a config populated with defaults.
type RetryableMessageProcessorConfig ¶ added in v0.3.0
type RetryableMessageProcessorConfig struct {
MaxAttempts int `description:"Maximum number of attempts to process kinesis message"`
}
RetryableMessageProcessorConfig is the config for creating a RetryableMessageProcessor
func (*RetryableMessageProcessorConfig) Name ¶ added in v0.3.0
func (*RetryableMessageProcessorConfig) Name() string
Name of the config root.