-
Notifications
You must be signed in to change notification settings - Fork 5
Size limit of batched messages #24
Description
The ability to send messages in batches was introduced in #14, which utilises the batch sending implementation of each messaging provider. Currently, Service Bus has a message size limit of 256KB for Standard tier Service Bus Namespaces and this limit is also applied to the size of a batch that is sent. The generic EnqueueAsync methods serialise content into byte[] payloads in order to initialise QueueMessages. This means that the size of the content of each message can be calculated, and thus the size of a batch can be calculated.
The proposed solution to this problem is to internally process batch send requests. Messages can be handled individually when adding them to a batch - with direct access to the size of each message - and once a batch has reached the size limit, messages can be added to a new batch. All batches can then be sent to the selected messaging provider internally, granting users safety when calling batch sending endpoints.