/// <summary> /// Initializes a new instance of the <see cref="PoisonMessagePersistence"/> class. /// </summary> /// <param name="args">The <see cref="PoisonMessageCreatePersistenceArgs"/>.</param> public PoisonMessagePersistence(PoisonMessageCreatePersistenceArgs args) { _args = args ?? throw new ArgumentNullException(nameof(args)); _storagePartitionKey = $"{_args.Options.EventHubPath}-{_args.Options.EventHubName}"; _storageRowKey = $"{_args.Context.ConsumerGroupName}-{_args.Context.PartitionId}"; // Get the connection string and connect to the table storage. var cs = args.Config.GetWebJobsConnectionString(ConnectionStringNames.Storage); _poisonTable = GetPoisonMessageTable(cs).Result; _skippedTable = GetPoisonMessageSkippedTable(cs).Result; }
/// <summary> /// Creates an instance of the <see cref="IPoisonMessagePersistence"/> using the <see cref="Register">registered</see> function. /// </summary> /// <param name="args">The <see cref="PoisonMessageCreatePersistenceArgs"/>.</param> /// <returns>An <see cref="IPoisonMessagePersistence"/> instance.</returns> public static IPoisonMessagePersistence Create(PoisonMessageCreatePersistenceArgs args) => _create(args);