-
Notifications
You must be signed in to change notification settings - Fork 843
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
rewrite gcp_pubsub output #1836
Conversation
"github.com/benthosdev/benthos/v4/internal/message" | ||
"github.com/benthosdev/benthos/v4/internal/metadata" | ||
"github.com/benthosdev/benthos/v4/public/service" | ||
"github.com/sourcegraph/conc/pool" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This library has a useful result pool, kind of like of Promise.allSettled. If it's a no go then I'd be happy to put something together with errgroup or similar.
https://pkg.go.dev/github.com/sourcegraph/conc/pool#ResultPool
service.NewMetadataFilterField("metadata"). | ||
Optional(). | ||
Description("Specify criteria for which metadata values are sent as attributes."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change because the old api added metadata.exclude_prefixes
whereas the new api added metadata.include_prefixes
and metadata.include_patterns
. Should I manually implement the old config somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might expand the public field definition so that you can toggle exclusive versus inclusive defaults. Ideally all components will eventually converge but we need to do it in stages (with backwards compatibility).
84d60aa
to
854e5f6
Compare
34604a4
to
9e35295
Compare
9e35295
to
81c4914
Compare
This change rewrites the gcp_pubsub output to use the new config API and to lean on the pubsub client's internal batching mechanism. This is referred to as the "internal buffer" in docs to distinguish it from Benthos' batching mechanism. The rewrite also benefits from added tests and a pubsub mock. Signed-off-by: Georges Haidar <[email protected]>
81c4914
to
da84c26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @disintegrator, going to switch to the new NewMetadataExcludeFilter
to fill the gap in backwards compat.
This change rewrites the gcp_pubsub output to use the new config API and to lean on the pubsub client's internal batching mechanism. This is referred to as the "internal buffer" in docs to distinguish it from Benthos' batching mechanism. The rewrite also benefits from added tests and a pubsub mock.
Stress test results on an M1 Pro (8-core, 16GB mem):
(
gc_gcp_pubsub
is the working name of the output in this PR that doesn't clash with the existig output)