Purpose of Batch Operations (enableBatchedOperations) in Topic/Subs in Azure Service Bus?

huangapple go评论55阅读模式
英文:

Purpose of Batch Operations (enableBatchedOperations) in Topic/Subs in Azure Service Bus?

问题

"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);

尽管如此,您仍然能够使用TopicClient.sendBatch(Collection<? extends IMessage> messages)方法以批处理模式发送消息,并且能够使用IMessageReceiver.receiveBatch(int maxMessageCount)从每个订阅中读取消息。这可能是因为批量操作的启用状态可能影响的不仅仅是消息的发送和接收方式,还可能包括底层的管理操作。

"enableBatchedOperations"的具体目的可能因不同的消息队列服务而异,但通常情况下,它允许将多个操作组合成批次,以提高性能和效率。但是,是否允许批量操作以及它们如何影响发送和接收消息以及管理操作可能因消息队列服务的实现而异。

如果您仍然对此行为感到困惑,建议查看相关消息队列服务的文档或与支持团队联系,以获得更具体的信息和解释。

英文:

I have a topic with two subscriptions. batchoperation is disabled at both topic level and subs level:

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

I verified these settings thru Service Bus Explorer.

However, I am still able to send messages to topic in batch mode using TopicClient.sendBatch(Collection&lt;? extends IMessage&gt; messages) method. And I am able to read messages from each Sub using IMessageReceiver.receiveBatch(int maxMessageCount). How is this possible? Did I not understand the purpose of
enableBatchedOperations?

What is the purpose of enableBatchedOperations?

答案1

得分: 2

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

英文:

When you send a batch of messages, that's a client-side batching.
Entity level batching is designed to improve broker-side throughput with some added latency. See documentation here.

huangapple
  • 本文由 发表于 2020年1月3日 20:41:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578837.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定