我想同时处理会话。但是,在每个会话中,我一次只想处理一条消息。
ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder()
.credential(new DefaultAzureCredentialBuilder().build())
.fullyQualifiedNamespace(InsightsServiceSBEndPoint)
.sessionProcessor()
.queueName(SuccesQueue)
.maxConcurrentSessions(5)
.maxConcurrentCalls(5)
通过上述设置,处理器可以按预期同时处理多个会话。但是如果我为会话 id#1 发送 3 条消息,我会看到所有 3 条消息正在同时处理。我希望这 3 条消息被依次处理(否则使用会话没有任何好处)
我错过了什么?
您已通过指定
maxConcurrentCalls(5)
将处理器配置为同时处理来自同一会话的最多 5 条消息。