zam*_*tex 6 .net c# message-queue amqp rabbitmq
有没有办法使用.NET使用单个同步调用接收多个消息?
我见过问题,我发现了java类com.rabbitmq.client.QueueingConsumer,但我还没有在.NET命名空间中找到这样的客户端类(RabbitMQ.Client,RabbitMQ.Client.Events)
您可以使用以下命令检索任意数量的消息BasicQoS.PrefetchCount:
var model = _rabbitConnection.CreateModel();\n// Configure the Quality of service for the model. Below is how what each setting means.\n// BasicQos(0="Dont send me a new message untill I\xe2\x80\x99ve finshed", _fetchSize = "Send me N messages at a time", false ="Apply to this Model only")\nmodel.BasicQos(0, fetchSize, false);\nRun Code Online (Sandbox Code Playgroud)\n\n注意:如果您设置 fetchSize = 20,那么它将检索队列中当前的前 20 条消息。但是,一旦队列被清空,它就不会等待队列中积累 20 条消息,而是开始尽快消耗它们,一次最多获取 20 条消息 。
\n\n希望这是有道理的。
\n| 归档时间: |
|
| 查看次数: |
2830 次 |
| 最近记录: |