/// <summary> /// <para> /// Adds the necessary services to enable the <see cref="OffsetStoreExactlyOnceStrategy" /> using a /// database table as store. /// </para> /// <para> /// The <see cref="OffsetStoreExactlyOnceStrategy" /> stores uses an <see cref="IOffsetStore" /> to /// keep track of the latest processed offsets and guarantee that each message is processed only once. /// </para> /// </summary> /// <param name="brokerOptionsBuilder"> /// The <see cref="IBrokerOptionsBuilder" /> that references the <see cref="IServiceCollection" /> to /// add the services to. /// </param> /// <returns> /// The <see cref="IBrokerOptionsBuilder" /> so that additional calls can be chained. /// </returns> public static IBrokerOptionsBuilder AddOffsetStoreDatabaseTable(this IBrokerOptionsBuilder brokerOptionsBuilder) { Check.NotNull(brokerOptionsBuilder, nameof(brokerOptionsBuilder)); return(brokerOptionsBuilder.AddOffsetStore <DbOffsetStore>()); }
/// <summary> /// <para> /// Adds the necessary services to enable the <see cref="OffsetStoreExactlyOnceStrategy" /> storing the /// offsets in memory. /// </para> /// <para> /// The <see cref="OffsetStoreExactlyOnceStrategy" /> stores uses an <see cref="IOffsetStore" /> to /// keep track of the latest processed offsets and guarantee that each message is processed only once. /// </para> /// </summary> /// <param name="brokerOptionsBuilder"> /// The <see cref="IBrokerOptionsBuilder" /> that references the <see cref="IServiceCollection" /> to /// add the services to. /// </param> /// <returns> /// The <see cref="IBrokerOptionsBuilder" /> so that additional calls can be chained. /// </returns> public static IBrokerOptionsBuilder AddInMemoryOffsetStore(this IBrokerOptionsBuilder brokerOptionsBuilder) { Check.NotNull(brokerOptionsBuilder, nameof(brokerOptionsBuilder)); return(brokerOptionsBuilder.AddOffsetStore <InMemoryOffsetStore>()); }