/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Persistence/MassTransit.Azure.Storage/Configuration/MessageDataRepositorySelectorExtensions.cs
34 строки
1 KB
Celia Moreno
Add Configuration for Compression in AzureStorageMessageDataRepository for Claim Check (#5744)
09 янв 2025, 17:20
Не верифицирован
09 янв 2025, 17:20
99eb142
Код
Авторство
О чём код?
namespace MassTransit { using System; using Azure.Storage.Blobs; using Configuration; public static class MessageDataRepositorySelectorExtensions { /// <summary> /// Use Azure Blob Storage for message data storage /// </summary> /// <param name="selector"></param> /// <param name="connectionString"></param> /// <param name="containerName">Specify the container name (defaults to message-data)</param> /// <param name="compress">Specify if the file should be compressed (defaults to false)</param> /// <returns></returns> /// <exception cref="ArgumentNullException"></exception> public static IMessageDataRepository AzureStorage(this IMessageDataRepositorySelector selector, string connectionString, string containerName = default, bool compress = false) { if (selector is null) throw new ArgumentNullException(nameof(selector)); if (string.IsNullOrEmpty(connectionString)) throw new ArgumentNullException(nameof(connectionString)); var client = new BlobServiceClient(connectionString); var repository = client.CreateMessageDataRepository(containerName ?? "message-data", compress); return repository; } } }