Class BatchOptions
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
Batch options are applied to a Batch<T> consumer to configure the size and time limits for each batch.
public class BatchOptions : IOptions, IConfigureReceiveEndpoint, ISpecification
- Inheritance
-
BatchOptions
- Implements
- Inherited Members
- Extension Methods
Constructors
BatchOptions()
public BatchOptions()
Properties
ConcurrencyLimit
The number of batches which can be executed concurrently
public int ConcurrencyLimit { get; set; }
Property Value
GroupKeyProvider
The property to group by
public object? GroupKeyProvider { get; }
Property Value
MessageLimit
The maximum number of messages in a single batch
public int MessageLimit { get; set; }
Property Value
TimeLimit
The maximum time to wait before delivering a partial batch
public TimeSpan TimeLimit { get; set; }
Property Value
TimeLimitStart
The starting point for the TimeLimit
public BatchTimeLimitStart TimeLimitStart { get; set; }
Property Value
Methods
Configure(string, IReceiveEndpointConfigurator)
Configure the receive endpoint (called prior to any consumer, saga, or activity configuration)
public void Configure(string name, IReceiveEndpointConfigurator configurator)
Parameters
name
stringconfigurator
IReceiveEndpointConfigurator
GroupBy<T, TProperty>(Func<ConsumeContext<T>, TProperty?>)
public BatchOptions GroupBy<T, TProperty>(Func<ConsumeContext<T>, TProperty?> provider) where T : class where TProperty : struct
Parameters
provider
Func<ConsumeContext<T>, TProperty?>
Returns
Type Parameters
T
TProperty
GroupBy<T, TProperty>(Func<ConsumeContext<T>, TProperty>)
public BatchOptions GroupBy<T, TProperty>(Func<ConsumeContext<T>, TProperty> provider) where T : class where TProperty : class
Parameters
provider
Func<ConsumeContext<T>, TProperty>
Returns
Type Parameters
T
TProperty
SetConcurrencyLimit(int)
Sets the number of batches which can be executed concurrently
public BatchOptions SetConcurrencyLimit(int limit)
Parameters
limit
intThe message limit
Returns
SetMessageLimit(int)
Sets the maximum number of messages in a single batch
public BatchOptions SetMessageLimit(int limit)
Parameters
limit
intThe message limit
Returns
SetTimeLimit(int?, int?, int?, int?, int?)
Sets the maximum time to wait before delivering a partial batch
public BatchOptions SetTimeLimit(int? ms = null, int? s = null, int? m = null, int? h = null, int? d = null)
Parameters
Returns
SetTimeLimit(TimeSpan)
Sets the maximum time to wait before delivering a partial batch
public BatchOptions SetTimeLimit(TimeSpan limit)
Parameters
limit
TimeSpanThe message limit
Returns
SetTimeLimitStart(BatchTimeLimitStart)
Sets the starting point for the TimeLimit
public BatchOptions SetTimeLimitStart(BatchTimeLimitStart timeLimitStart)
Parameters
timeLimitStart
BatchTimeLimitStartThe starting point
Returns
Validate()
Validate the specification, ensuring that a successful build will occur.
public IEnumerable<ValidationResult> Validate()