我得到了一个有很多消息的队列。
我要求每次读取/交易 200 条消息:
using (var connection = _configuration.ConnectionFactory.OpenConnection())
{
using (var transaction = connection.BeginTransaction())
{
using (var command = connection.CreateCommand())
{
command.Transaction = transaction;
command.CommandText = string.Format(ReadCommand, maxNumberOfMessagesPerRead, _queueName);
生成的 SQL:
RECEIVE TOP(200) message_body, conversation_handle FROM [BenchQueue]
但我每次阅读只会收到 100 条消息。SQL Server 有限制还是我做错了什么?