'SubscriptionClient' 不包含 'PeekBatch' 和 ReceiveBatch 的定义
'SubscriptionClient' does not contain a definition for 'PeekBatch' and ReceiveBatch
我有一个 netstandard2.1
应用程序,我正在使用 nuget 包 "Microsoft.Azure.ServiceBus" Version="4.1.1"
。
我正在创建一个 azure 服务总线 SubscriptionClient
并尝试使用 PeekBatch
和 ReceiveBatch
,但我遇到了以下错误,这里缺少什么?
'SubscriptionClient' does not contain a definition for 'PeekBatch' and no accessible extension method 'PeekBatch' accepting a first argument of type 'SubscriptionClient' could be found
'SubscriptionClient' does not contain a definition for 'ReceiveBatch' and no accessible extension method 'PeekBatch' accepting a first argument of type 'SubscriptionClient' could be found
_subscriptionClient = new SubscriptionClient(connectionString, topicName, subscriptionName, ReceiveMode.ReceiveAndDelete);
_subscriptionClient.PrefetchCount = 16;
while (_subscriptionClient.PeekBatch(16).Any())
{
var pendingMessages = _subscriptionClient.ReceiveBatch(16, TimeSpan.FromSeconds(1))?.ToList();
if (pendingMessages != null)
{
foreach (var message in pendingMessages)
{
// do processing of the message
}
}
}
您目前无法使用 .net standard 或 core 中的批处理方法和预取。
Prefetching
This section only applies to the WindowsAzure.ServiceBus SDK, as the Microsoft.Azure.ServiceBus SDK does not expose batch functions.
请注意此处的 WindowsAzure:https://www.nuget.org/packages/WindowsAzure.ServiceBus/
Please note that this package requires at least .Net Framework 4.6.2.
仅是 .net,不支持 net core 或 net standard
我有一个 netstandard2.1
应用程序,我正在使用 nuget 包 "Microsoft.Azure.ServiceBus" Version="4.1.1"
。
我正在创建一个 azure 服务总线 SubscriptionClient
并尝试使用 PeekBatch
和 ReceiveBatch
,但我遇到了以下错误,这里缺少什么?
'SubscriptionClient' does not contain a definition for 'PeekBatch' and no accessible extension method 'PeekBatch' accepting a first argument of type 'SubscriptionClient' could be found
'SubscriptionClient' does not contain a definition for 'ReceiveBatch' and no accessible extension method 'PeekBatch' accepting a first argument of type 'SubscriptionClient' could be found
_subscriptionClient = new SubscriptionClient(connectionString, topicName, subscriptionName, ReceiveMode.ReceiveAndDelete);
_subscriptionClient.PrefetchCount = 16;
while (_subscriptionClient.PeekBatch(16).Any())
{
var pendingMessages = _subscriptionClient.ReceiveBatch(16, TimeSpan.FromSeconds(1))?.ToList();
if (pendingMessages != null)
{
foreach (var message in pendingMessages)
{
// do processing of the message
}
}
}
您目前无法使用 .net standard 或 core 中的批处理方法和预取。
Prefetching
This section only applies to the WindowsAzure.ServiceBus SDK, as the Microsoft.Azure.ServiceBus SDK does not expose batch functions.
请注意此处的 WindowsAzure:https://www.nuget.org/packages/WindowsAzure.ServiceBus/
Please note that this package requires at least .Net Framework 4.6.2.
仅是 .net,不支持 net core 或 net standard