Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sqs and dynamodb prefixes to connection urls #721

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions v1/factories.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ func BrokerFactory(cnf *config.Config) (brokeriface.Broker, error) {
if strings.HasPrefix(cnf.Broker, "https://sqs") {
return sqsbroker.New(cnf), nil
}

const sqsPrefix = "sqs+"
if strings.HasPrefix(cnf.Broker, sqsPrefix) {
cnf.Broker = strings.TrimPrefix(cnf.Broker, sqsPrefix)
return sqsbroker.New(cnf), nil
}
}

if strings.HasPrefix(cnf.Broker, "gcppubsub://") {
Expand Down Expand Up @@ -179,6 +185,12 @@ func BackendFactory(cnf *config.Config) (backendiface.Backend, error) {
return dynamobackend.New(cnf), nil
}

const dynamodbPrefix = "dynamodb+"
if strings.HasPrefix(cnf.ResultBackend, dynamodbPrefix) {
cnf.ResultBackend = strings.TrimPrefix(cnf.ResultBackend, dynamodbPrefix)
return dynamobackend.New(cnf), nil
}

return nil, fmt.Errorf("Factory failed with result backend: %v", cnf.ResultBackend)
}

Expand Down