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

Allow for a redundant AMQP URL #912

Merged

Conversation

dviramontes
Copy link
Contributor

addresses #909

@dviramontes dviramontes force-pushed the dviramontes/amqp_0_9-retry-dial branch from d158301 to 8ba3c2a Compare October 21, 2021 03:06
Copy link
Collaborator

@Jeffail Jeffail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Left a few comments but this is pretty close to what I had in mind 👍

@@ -37,6 +41,7 @@ type AMQP09BindingConfig struct {
// AMQP09Config contains configuration for the AMQP09 input type.
type AMQP09Config struct {
URL string `json:"url" yaml:"url"`
URLs string `json:"urls" yaml:"urls"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comma separated list is good for environment variable interpolation, but having an explicit list of urls with a []string here makes the config cleaner, so I've actually been doing both in other places: https://github.com/Jeffail/benthos/blob/master/lib/input/kafka.go#L249, would be good to match that behaviour here.

if err != nil {
return fmt.Errorf("AMQP 0.9 Connect: %s", err)
}
if a.conf.URL != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check needs to be flipped as the old url field has a default value, so when it's not present in a config it'll still have that default value. Ideally we should have a []string of urls that is by default empty, and when one or more urls are present there we use that value, otherwise we go back to url for backwards compatibility.

@@ -101,20 +103,26 @@ You can access these metadata fields using

## Fields

### `url`
### `urls`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result of running make docs not sure if this step should be part of the PR or maybe its automated ?

@dviramontes dviramontes marked this pull request as ready for review October 22, 2021 05:20
@dviramontes dviramontes changed the title wip: Allow for a redundant AMQP URL Allow for a redundant AMQP URL Oct 22, 2021
@Jeffail
Copy link
Collaborator

Jeffail commented Oct 22, 2021

Thanks @dviramontes, looks good. There's a couple of changes I want to make and I'm going to copy this over to the output as well, but I'll merge first.

@Jeffail Jeffail merged commit b6d8e85 into redpanda-data:master Oct 22, 2021
@dviramontes dviramontes deleted the dviramontes/amqp_0_9-retry-dial branch October 25, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants