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

Make it possible to configure max_recv_batch_size in Azure service bus. #3395

Merged
merged 1 commit into from
Mar 6, 2024
Merged
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
9 changes: 9 additions & 0 deletions pubsub/azuresb/azuresb.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"net/url"
"os"
"path"
"strconv"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -233,6 +234,14 @@
}
opts.ListenerTimeout = d
}
if mrbss := q.Get("max_recv_batch_size"); mrbss != "" {
q.Del("max_recv_batch_size")
mrbs, err := strconv.Atoi(mrbss)
if err != nil {
return nil, fmt.Errorf("open subscription %v: invalid max_recv_batch_size %q: %v", u, mrbss, err)

Check warning on line 241 in pubsub/azuresb/azuresb.go

View check run for this annotation

Codecov / codecov/patch

pubsub/azuresb/azuresb.go#L238-L241

Added lines #L238 - L241 were not covered by tests
}
opts.ReceiveBatcherOptions.MaxBatchSize = mrbs

Check warning on line 243 in pubsub/azuresb/azuresb.go

View check run for this annotation

Codecov / codecov/patch

pubsub/azuresb/azuresb.go#L243

Added line #L243 was not covered by tests
}
for param := range q {
return nil, fmt.Errorf("open subscription %v: invalid query parameter %q", u, param)
}
Expand Down
Loading