Open macchmie3 opened 2 years ago
I have checked with sql profiler that all messages are sent in a single transaction, but are done via single insert operations, is there a way to insert multiple rows in a single db operation?
Not at the moment, no.
But it would definitely be possible for the SQL transport to optimize this, simply by storing messages to be sent in the transaction context, and then do the insertion when committing the message transaction.
I can take a look at this myself when my summer holiday is over 😎 or if anyone feels like fixing it and submit a PR, I'll be happy to be here with guidance.
I left a half implementation here: https://github.com/rebus-org/Rebus.SqlServer/tree/feature/batching
Will come back to it soon. 🙂
Hi, my question is simple - Let's assume I want to send 10000 messages, while being in a message handler already. Can I do optimization in any way? I see no API methods for sending a collection of messages and I was wondering if there are any ways to optimize work in such case. Current code would be something of a sort:
I'm not sure if it helps, but I use SqlServer in leased mode as transport layer.