Skip to content

Conversation

TomMalow
Copy link
Contributor

The new method will publish multiple messages in a batch. If the messages exceed the batch size, the current batch will be sent and remaining will be send in a new batch. Multiple batches can be sent
The method will throw an exception if a single message exceeds the total allowed size of a single batch. Does not rollback any previous sent messages.

@TomMalow TomMalow force-pushed the feature/service-bus-publish-batch branch from 270af07 to 3d0a46b Compare May 25, 2023 08:34
@christianhelle
Copy link
Member

@TomMalow the build fails due to incorrect XML code documentation

@TomMalow TomMalow force-pushed the feature/service-bus-publish-batch branch from 3d0a46b to 53492e3 Compare May 25, 2023 08:39
…tches

The new method will publish multiple messages in a batch. If the messages exceed the batch size, the current batch will be sent and remaining will be send in a new batch. Multiple batches can be sent
The method will throw an exception if a single message exceeds the total allowed size of a single batch. Does not rollback any previous sent messages.
@TomMalow TomMalow force-pushed the feature/service-bus-publish-batch branch from 53492e3 to b003eea Compare May 25, 2023 08:42
Copy link
Member

@christianhelle christianhelle left a comment

Choose a reason for hiding this comment

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

Looks good to me


var busMessage = CreateServiceBusMessage(
sessionId,
JsonSerializer.Serialize(message),
Copy link
Member

Choose a reason for hiding this comment

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

I think this pull request should go in but I also noticed that we are very opinionated about how the messages are serialized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree and have intention to separate this in a later PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was also the main reason why I could not use this package initially as I have customer converters

@christianhelle
Copy link
Member

Do you feel like adding usage examples in the README @TomMalow? Otherwise, I can do that in a separate pull request

@christianhelle christianhelle added the enhancement New feature or request label May 25, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@christianhelle christianhelle left a comment

Choose a reason for hiding this comment

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

Nice!

@TomMalow TomMalow changed the title Add new PublishAsync to send mutiple messages in batches Add new PublishAsync to send multiple messages in batches May 25, 2023
@TomMalow TomMalow merged commit fc4e224 into main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants