Skip to content

Commit

Permalink
Make the commit delay increment overridable (#330)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
  • Loading branch information
danielmarbach and danielmarbach authored Jul 2, 2024
1 parent 5e4bf0b commit 9c359ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace NServiceBus.TransactionalSession
public abstract class OpenSessionOptions
{
protected OpenSessionOptions() { }
public System.TimeSpan CommitDelayIncrement { get; set; }
protected NServiceBus.Extensibility.ContextBag Extensions { get; }
public System.TimeSpan MaximumCommitDuration { get; set; }
public System.Collections.Generic.IDictionary<string, string> Metadata { get; }
Expand Down
7 changes: 6 additions & 1 deletion src/NServiceBus.TransactionalSession/OpenSessionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ public abstract class OpenSessionOptions
/// The maximum duration the transaction is allowed to attempt to atomically commit.
/// </summary>
/// <remarks>The actual total transaction time observed might be longer, taking into account delays in the transport due to latency, delayed delivery and more.</remarks>
/// <remarks>Defaults to <code>TimeSpan.FromSeconds(15)</code></remarks>
public TimeSpan MaximumCommitDuration { get; set; } = TimeSpan.FromSeconds(15);

internal TimeSpan CommitDelayIncrement { get; set; } = TimeSpan.FromSeconds(2);
/// <summary>
/// The time increment used to delay the commit of the transactional session when the outbox record is not yet in the storage.
/// </summary>
/// <remarks>Defaults to <code>TimeSpan.FromSeconds(2)</code></remarks>
public TimeSpan CommitDelayIncrement { get; set; } = TimeSpan.FromSeconds(2);

Dictionary<string, string> metadata;
}
Expand Down

0 comments on commit 9c359ad

Please sign in to comment.