/// <summary> /// Sets the additional sender information. /// </summary> /// <returns>Task.</returns> private async Task SetAdditionalSenderInfo() { // Get information about the topic/queue for the sender. if (SenderInfo.EntityType == EntityType.Topic) { if (SenderInfo.CreateEntityIfNotExists) { await Task.Run(() => ManagerClient.CreateTopicIfNotExists(SenderInfo.EntityName)); } var queue = await ManagerClient.GetTopicAsync(SenderInfo.EntityName); SenderInfo.MaxEntitySizeMb = queue.MaxSizeInMB; } else { if (SenderInfo.CreateEntityIfNotExists) { await Task.Run(() => ManagerClient.CreateQueueIfNotExists(SenderInfo.EntityName)); } var queue = await ManagerClient.GetQueueAsync(SenderInfo.EntityName); SenderInfo.MaxEntitySizeMb = queue.MaxSizeInMB; } SenderInfo.MaxMessageBatchSizeBytes = IsPremiumTier ? 1024000 : 256000; }
/// <summary> /// Sets the additional receiver information. /// </summary> /// <returns>Task.</returns> private async Task SetAdditionalReceiverInfo() { // Get information about the topic/queue for the receiver. if (ReceiverInfo.EntityType == EntityType.Topic) { if (ReceiverInfo.CreateEntityIfNotExists) { await Task.Run(() => ManagerClient.CreateTopicIfNotExists(ReceiverInfo.EntityName, ReceiverInfo.EntitySubscriptionName, ReceiverInfo.EntityFilter)); } var topic = await ManagerClient.GetTopicAsync(ReceiverInfo.EntityName); var subscription = await ManagerClient.GetSubscriptionAsync(ReceiverInfo.EntityName, ReceiverInfo.EntitySubscriptionName); ReceiverInfo.MaxEntitySizeMb = topic.MaxSizeInMB; ReceiverInfo.MaxLockDuration = subscription.LockDuration; } else { if (ReceiverInfo.CreateEntityIfNotExists) { await Task.Run(() => ManagerClient.CreateQueueIfNotExists(ReceiverInfo.EntityName)); } var queue = await ManagerClient.GetQueueAsync(ReceiverInfo.EntityName); ReceiverInfo.MaxLockDuration = queue.LockDuration; ReceiverInfo.MaxEntitySizeMb = queue.MaxSizeInMB; } }