Skip to content

Commit

Permalink
feat: Added dlq option to aws-sqs eventsource spec (argoproj#1403)
Browse files Browse the repository at this point in the history
* feat: Added dlq option to aws-sqs eventsource spec

Signed-off-by: Daniel Soifer <[email protected]>

* codegen

Signed-off-by: Daniel Soifer <[email protected]>
  • Loading branch information
daniel-codefresh authored and BulkBeing committed Mar 7, 2022
1 parent 98a0feb commit cc68615
Show file tree
Hide file tree
Showing 8 changed files with 449 additions and 373 deletions.
14 changes: 14 additions & 0 deletions api/event-source.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions api/event-source.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion eventsources/sources/awssqs/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ func (el *EventListener) processMessage(ctx context.Context, message *sqslib.Mes
if err != nil {
log.Errorw("failed to marshal event data, will process next message...", zap.Error(err))
el.Metrics.EventProcessingFailed(el.GetEventSourceName(), el.GetEventName())
ack()
// Don't ack if a DLQ is configured to allow to forward the message to the DLQ
if !el.SQSEventSource.DLQ {
ack()
}
return
}
if err = dispatch(eventBytes); err != nil {
Expand Down
767 changes: 395 additions & 372 deletions pkg/apis/eventsource/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions pkg/apis/eventsource/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/apis/eventsource/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/eventsource/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ type SQSEventSource struct {
// Metadata holds the user defined metadata which will passed along the event payload.
// +optional
Metadata map[string]string `json:"metadata,omitempty" protobuf:"bytes,9,rep,name=metadata"`
// DLQ specifies if a dead-letter queue is configured for messages that can't be processed successfully.
// If set to true, messages with invalid payload won't be acknowledged to allow to forward them farther to the dead-letter queue.
// The default value is false.
// +optional
DLQ bool `json:"dlq,omitempty" protobuf:"varint,10,opt,name=dlq"`
}

// PubSubEventSource refers to event-source for GCP PubSub related events.
Expand Down

0 comments on commit cc68615

Please sign in to comment.