Interface IConsumerEndpointBuilder<TBuilder>
Builds the ConsumerEndpoint.
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public interface IConsumerEndpointBuilder<out TBuilder> : IEndpointBuilder<TBuilder> where TBuilder : IConsumerEndpointBuilder<out TBuilder>
Type Parameters
| Name | Description |
|---|---|
| TBuilder | The actual builder type. |
Methods
| Improve this doc View sourceDecrypt(EncryptionSettings)
Specifies the EncryptionSettings to be used to decrypt the messages.
Declaration
TBuilder Decrypt(EncryptionSettings encryptionSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| EncryptionSettings | encryptionSettings | The EncryptionSettings. |
Returns
| Type | Description |
|---|---|
| TBuilder | The endpoint builder so that additional calls can be chained. |
DeserializeUsing(IMessageSerializer)
Specifies the IMessageSerializer to be used to deserialize the messages.
Declaration
TBuilder DeserializeUsing(IMessageSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageSerializer | serializer | The IMessageSerializer. |
Returns
| Type | Description |
|---|---|
| TBuilder | The endpoint builder so that additional calls can be chained. |
EnableBatchProcessing(int, TimeSpan?)
Enables batch processing.
Declaration
TBuilder EnableBatchProcessing(int batchSize, TimeSpan? maxWaitTime = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | batchSize | The number of messages to be processed in batch. |
| TimeSpan? | 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
TBuilder EnsureExactlyOnce(IExactlyOnceStrategy strategy)
Parameters
| Type | Name | Description |
|---|---|---|
| IExactlyOnceStrategy | strategy | The IExactlyOnceStrategy. |
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
TBuilder EnsureExactlyOnce(Action<IExactlyOnceStrategyBuilder> strategyBuilderAction)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<IExactlyOnceStrategyBuilder> | strategyBuilderAction | An Action<T> that takes the IExactlyOnceStrategyBuilder and configures it. |
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 UseLegacyNullMessageHandling() or SkipNullMessages() methods to change it.
Declaration
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
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
TBuilder OnError(IErrorPolicy errorPolicy)
Parameters
| Type | Name | Description |
|---|---|---|
| IErrorPolicy | errorPolicy | The IErrorPolicy. |
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
TBuilder OnError(Action<IErrorPolicyBuilder> errorPolicyBuilderAction)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<IErrorPolicyBuilder> | errorPolicyBuilderAction | An Action<T> that takes the IErrorPolicyBuilder and configures it. |
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
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 IgnoreUnhandledMessages() to disable it.
Declaration
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
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
TBuilder WithSequenceTimeout(TimeSpan timeout)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeout | The timeout. |
Returns
| Type | Description |
|---|---|
| TBuilder | The endpoint builder so that additional calls can be chained. |
Remarks
This setting is ignored for batches (BatchSequence), use the
maxWaitTime parameter of
EnableBatchProcessing(int, TimeSpan?) instead.