/// <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;
        }
Exemplo n.º 2
0
 /// <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);