Class ConsumerEndpointBuilder<TEndpoint, TBuilder>
The base class for the builders of the types inheriting from Consumer
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public abstract class ConsumerEndpointBuilder<TEndpoint, TBuilder> : EndpointBuilder<TEndpoint, TBuilder>, IConsumerEndpointBuilder<TBuilder>, IEndpointBuilder<TBuilder> where TEndpoint : ConsumerEndpoint where TBuilder : IConsumerEndpointBuilder<TBuilder>
Type Parameters
Name | Description |
---|---|
TEndpoint | The type of the endpoint being built. |
TBuilder | The actual builder type. |
Constructors
| Improve this doc View sourceConsumerEndpointBuilder(Type?, IEndpointsConfigurationBuilder?)
Initializes a new instance of the ConsumerEndpointBuilder<TEndpoint, TBuilder> class.
Declaration
protected ConsumerEndpointBuilder(Type? messageType = null, IEndpointsConfigurationBuilder? endpointsConfigurationBuilder = null)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the message being consumed. |
IEndpoints |
endpointsConfigurationBuilder | The optional reference to the IEndpoints |
Methods
| Improve this doc View sourceBuild()
Builds the endpoint instance.
Declaration
public override TEndpoint Build()
Returns
Type | Description |
---|---|
TEndpoint | The endpoint. |
Overrides
| Improve this doc View sourceDecrypt(EncryptionSettings)
Specifies the Encryption
Declaration
public TBuilder Decrypt(EncryptionSettings encryptionSettings)
Parameters
Type | Name | Description |
---|---|---|
Encryption |
encryptionSettings | The Encryption |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
DeserializeUsing(IMessageSerializer)
Specifies the IMessage
Declaration
public TBuilder DeserializeUsing(IMessageSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IMessage |
serializer | The IMessage |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
EnableBatchProcessing(int, TimeSpan?)
Enables batch processing.
Declaration
public TBuilder EnableBatchProcessing(int batchSize, TimeSpan? maxWaitTime = null)
Parameters
Type | Name | Description |
---|---|---|
int | batchSize | The number of messages to be processed in batch. |
Time |
maxWaitTime | The maximum amount of time to wait for the batch to be filled. After this time the batch will be
completed even if the specified |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
EnsureExactlyOnce(IExactlyOnceStrategy)
Specifies the strategy to be used to ensure that each message is processed exactly once.
Declaration
public TBuilder EnsureExactlyOnce(IExactlyOnceStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
IExactly |
strategy | The IExactly |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
EnsureExactlyOnce(Action<IExactlyOnceStrategyBuilder>)
Specifies the strategy to be used to ensure that each message is processed exactly once.
Declaration
public TBuilder EnsureExactlyOnce(Action<IExactlyOnceStrategyBuilder> strategyBuilderAction)
Parameters
Type | Name | Description |
---|---|---|
Action<IExactly |
strategyBuilderAction | An Action<T> that takes the IExactly |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
HandleTombstoneMessages()
Specifies that the null messages have to be mapped to a Tombstone<TMessage> (
Tombstone). This is the default behavior, use the
Use
Declaration
public TBuilder HandleTombstoneMessages()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
IgnoreUnhandledMessages()
Specifies that the message has to be silently ignored if no subscriber is handling it.
Declaration
public TBuilder IgnoreUnhandledMessages()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
OnError(IErrorPolicy)
Specifies the error policy to be applied when an exception occurs during the processing of the consumed messages.
Declaration
public TBuilder OnError(IErrorPolicy errorPolicy)
Parameters
Type | Name | Description |
---|---|---|
IError |
errorPolicy | The IError |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
OnError(Action<IErrorPolicyBuilder>)
Specifies the error policy to be applied when an exception occurs during the processing of the consumed messages.
Declaration
public TBuilder OnError(Action<IErrorPolicyBuilder> errorPolicyBuilderAction)
Parameters
Type | Name | Description |
---|---|---|
Action<IError |
errorPolicyBuilderAction | An Action<T> that takes the IError |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
SkipNullMessages()
Specifies that the null messages have to be silently skipped ( Skip).
Declaration
public TBuilder SkipNullMessages()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
ThrowIfUnhandled()
Specifies that an exception must be thrown if no subscriber is handling the received message. This
option is enabled by default. Use the
Ignore
Declaration
public TBuilder ThrowIfUnhandled()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
UseLegacyNullMessageHandling()
Specifies that the null messages have to be forwarded as null
(
Legacy).
Declaration
public TBuilder UseLegacyNullMessageHandling()
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
WithSequenceTimeout(TimeSpan)
Sets the timeout after which an incomplete sequence that isn't pushed with new messages will be aborted and discarded. The default is a conservative 30 minutes.
Declaration
public TBuilder WithSequenceTimeout(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
Time |
timeout | The timeout. |
Returns
Type | Description |
---|---|
TBuilder | The endpoint builder so that additional calls can be chained. |
Remarks
This setting is ignored for batches (BatchmaxWaitTime
parameter of
Enable