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

[service-bus] Batch receiving #15156

Closed
richardpark-msft opened this issue Jul 27, 2021 · 2 comments
Closed

[service-bus] Batch receiving #15156

richardpark-msft opened this issue Jul 27, 2021 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus

Comments

@richardpark-msft
Copy link
Member

richardpark-msft commented Jul 27, 2021

Batch receiving is receiving messages with a finite limit. This differs from streaming in that you should be able to request 5 messages and get no more than 5 messages.

In JS they also drain the link after the receive so no excess messages or internal cache is required, which removes a whole class of potential problems.

Both of these are not implemented in the go-amqp library today. You are always forced to create a link with rolling credits turned on and cannot adjust it after the link has been created.

The typical use case for this kind of API is a set of workers that come up, process a message, and then die (for instance, workers in a build system).

The usage would be similar to this:

// NOTE: context.WithTimeout() is probably more 'go' appropriate for the timeout.
messages, err := receiver.ReceiveMessages(ctx, 5, timeout)

if err != nil {
  // elided
}

for _, message := range messages {
  receiver.CompleteMessage(ctx, message)
}

As referenced in: #15092
(AMQP work should be included as part of #14907)

@richardpark-msft richardpark-msft added Service Bus Client This issue points to a problem in the data-plane of the library. labels Jul 27, 2021
@richardpark-msft richardpark-msft self-assigned this Jul 27, 2021
@RickWinter RickWinter added the feature-request This issue requires a new behavior in the product in order be resolved. label Jul 27, 2021
@richardpark-msft richardpark-msft added this to the [2021] September milestone Jul 27, 2021
richardpark-msft added a commit that referenced this issue Sep 10, 2021
… credit APIs (#15480)

Adding in support for the 'batch receiving' APIs in Service Bus. This is pretty much the API surface we've used for all the other Service Bus track 2 SDKs.

This PR also adds in more live and unit tests to bring up coverage a bit. The changes were getting a bit large so I figured  we should review and commit.

Closes #15156, #15171
@richardpark-msft
Copy link
Member Author

Fixed as of #15480

@richardpark-msft
Copy link
Member Author

Fixed as of #15480

benbp pushed a commit to benbp/azure-sdk-for-go that referenced this issue Sep 15, 2021
… credit APIs (Azure#15480)

Adding in support for the 'batch receiving' APIs in Service Bus. This is pretty much the API surface we've used for all the other Service Bus track 2 SDKs.

This PR also adds in more live and unit tests to bring up coverage a bit. The changes were getting a bit large so I figured  we should review and commit.

Closes Azure#15156, Azure#15171
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus
Projects
None yet
Development

No branches or pull requests

2 participants