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] Caching AMQP messages within AmqpMessageBatch #30305

Merged
merged 45 commits into from
Aug 18, 2022

Conversation

m-redding
Copy link
Member

@m-redding m-redding commented Aug 4, 2022

The main focus of the changes here is to implement the changes in AmqpMessageBatch in Service Bus that have already been made to the EventDataBatch in Event Hubs. Rather than serializing each ServiceBusMessage twice before send (once to measure size, and once to actually send), the improved AmqpMessageBatch simply serializes them and clones the AmqpMessage instance, allowing for a more efficient batching experience.

See #28866

Contributing to the Azure SDK

Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.

For specific information about pull request etiquette and best practices, see this section.

@ghost ghost added the Service Bus label Aug 4, 2022
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@m-redding
Copy link
Member Author

/azp run net - servicebus- tests

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@JoshLove-msft
Copy link
Member

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@check-enforcer
Copy link

check-enforcer bot commented Aug 4, 2022

This pull request is protected by Check Enforcer.
For more information about how to run a pipeline against this pull request, see this.

Copy link
Member

@jsquire jsquire left a comment

Choose a reason for hiding this comment

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

LGTM; I'll defer to Josh for the authoritative approval.

Copy link
Member

@JoshLove-msft JoshLove-msft left a comment

Choose a reason for hiding this comment

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

Looks great! Just a few remaining comments.

@JoshLove-msft
Copy link
Member

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@m-redding
Copy link
Member Author

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@m-redding m-redding merged commit 62f2223 into Azure:main Aug 18, 2022
@m-redding m-redding deleted the sb-amqp-cache branch August 18, 2022 22:02
sofiar-msft pushed a commit to sofiar-msft/azure-sdk-for-net that referenced this pull request Dec 7, 2022
)

* switching to amqp batch

* changing readonly type

* updating model factory

* making AmqpMessageConverter mockable

* big test revamp

* restructuring AmqpMessageBatchTests

* fixing reserved size overhead

* additional tests

* disposing amqp message

* Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpClient.cs

Co-authored-by: JoshLove-msft <[email protected]>

* Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Core/TransportMessageBatch.cs

Co-authored-by: Jesse Squire <[email protected]>

* indent

* additional tests

* removing servicebusmessages from batch pt 1

* remove sb messages from batch pt 2

* test updates

* additional test updates

* additional formatting and tests

* last test fix

* build fix

* fixing size calculation

* small test update

* Update sdk/servicebus/Azure.Messaging.ServiceBus/tests/Amqp/AmqpSenderTests.cs

Co-authored-by: JoshLove-msft <[email protected]>

* Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusModelFactory.cs

Co-authored-by: JoshLove-msft <[email protected]>

* Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusModelFactory.cs

Co-authored-by: JoshLove-msft <[email protected]>

* fixing field names

* test updates

* removing diagnostics update

* test updates

* feedback updates + test updateS

* static property

* name change to default

* moving rule manager methods

* remove duplicate instrumentation

* removing unnecessary code

* test fix

* removing unnecessary code

* Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSender.cs

Co-authored-by: JoshLove-msft <[email protected]>

* Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Diagnostics/EntityScopeFactory.cs

Co-authored-by: JoshLove-msft <[email protected]>

* small updates

* small change

* Switching method to private

Co-authored-by: JoshLove-msft <[email protected]>
Co-authored-by: Jesse Squire <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants