首页 > 解决方案 > Azure 服务总线中主题/订阅中的批处理操作 (enableBatchedOperations) 的用途?

问题描述

我有一个有两个订阅的主题。在主题级别和子级别都禁用批处理操作:

TopicDescription td = new TopicDescription(topicName);
td.setEnableBatchedOperations(false);
managementClient.createTopic(td);

SubscriptionDescription sd1 = new SubscriptionDescription(topicName, subOne);
sd1.setEnableBatchedOperations(false);

managementClient.createSubscription(sd1, somerule);

//2nd sub creation skipped

我通过 Service Bus Explorer 验证了这些设置。

但是,我仍然可以使用TopicClient.sendBatch(Collection<? extends IMessage> messages)方法以批处理模式向主题发送消息。而且我可以使用IMessageReceiver.receiveBatch(int maxMessageCount). 这怎么可能?我不明白 enableBatchedOperations 的目的吗?

enableBatchedOperations 的目的是什么?

标签: azureservicebus

解决方案


当您发送一批消息时,这就是客户端批处理。实体级批处理旨在通过增加一些延迟来提高代理端吞吐量。请参阅此处的文档。


推荐阅读