Show / Hide Table of Contents

    Class ConsumerEndpointBuilder<TEndpoint, TBuilder>

    The base class for the builders of the types inheriting from ConsumerEndpoint.

    Inheritance
    object
    EndpointBuilder<TEndpoint, TBuilder>
    ConsumerEndpointBuilder<TEndpoint, TBuilder>
    KafkaConsumerEndpointBuilder
    MqttConsumerEndpointBuilder
    Implements
    IConsumerEndpointBuilder<TBuilder>
    IEndpointBuilder<TBuilder>
    Inherited Members
    EndpointBuilder<TEndpoint, TBuilder>.MessageType
    EndpointBuilder<TEndpoint, TBuilder>.EndpointsConfigurationBuilder
    EndpointBuilder<TEndpoint, TBuilder>.This
    EndpointBuilder<TEndpoint, TBuilder>.WithName(string)
    EndpointBuilder<TEndpoint, TBuilder>.UseSerializer(IMessageSerializer)
    EndpointBuilder<TEndpoint, TBuilder>.WithEncryption(EncryptionSettings)
    EndpointBuilder<TEndpoint, TBuilder>.ValidateMessage(bool)
    EndpointBuilder<TEndpoint, TBuilder>.DisableMessageValidation()
    EndpointBuilder<TEndpoint, TBuilder>.Build()
    EndpointBuilder<TEndpoint, TBuilder>.CreateEndpoint()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 source

    ConsumerEndpointBuilder(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.

    IEndpointsConfigurationBuilder endpointsConfigurationBuilder

    The optional reference to the IEndpointsConfigurationBuilder that instantiated the builder.

    Methods

    | Improve this doc View source

    Build()

    Builds the endpoint instance.

    Declaration
    public override TEndpoint Build()
    Returns
    Type Description
    TEndpoint

    The endpoint.

    Overrides
    EndpointBuilder<TEndpoint, TBuilder>.Build()
    | Improve this doc View source

    Decrypt(EncryptionSettings)

    Specifies the EncryptionSettings to be used to decrypt the messages.

    Declaration
    public 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.

    | Improve this doc View source

    DeserializeUsing(IMessageSerializer)

    Specifies the IMessageSerializer to be used to deserialize the messages.

    Declaration
    public 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.

    | Improve this doc View source

    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.

    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 batchSize is not reached.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    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
    IExactlyOnceStrategy strategy

    The IExactlyOnceStrategy.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    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<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.

    | Improve this doc View source

    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
    public TBuilder HandleTombstoneMessages()
    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    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.

    | Improve this doc View source

    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
    IErrorPolicy errorPolicy

    The IErrorPolicy.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    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<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.

    | Improve this doc View source

    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.

    | Improve this doc View source

    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
    public TBuilder ThrowIfUnhandled()
    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    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.

    | Improve this doc View source

    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
    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.

    Implements

    IConsumerEndpointBuilder<TBuilder>
    IEndpointBuilder<TBuilder>

    Extension Methods

    ConsumerEndpointBuilderConsumeBinaryFilesExtensions.ConsumeBinaryFiles<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Action<IBinaryFileMessageSerializerBuilder>?)
    ConsumerEndpointBuilderDecryptUsingExtensions.DecryptUsingAes<TBuilder>(IConsumerEndpointBuilder<TBuilder>, byte[], byte[]?)
    ConsumerEndpointBuilderDecryptUsingExtensions.DecryptUsingAes<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Func<string?, byte[]>, byte[]?)
    ConsumerEndpointBuilderDeserializeJsonExtensions.DeserializeJson<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Action<IJsonMessageSerializerBuilder>?)
    ConsumerEndpointBuilderDeserializeJsonUsingNewtonsoftExtensions.DeserializeJsonUsingNewtonsoft<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Action<INewtonsoftJsonMessageSerializerBuilder>?)
    • Improve this doc
    • View source
    In this article
    • Constructors
      • ConsumerEndpointBuilder(Type?, IEndpointsConfigurationBuilder?)
    • Methods
      • Build()
      • Decrypt(EncryptionSettings)
      • DeserializeUsing(IMessageSerializer)
      • EnableBatchProcessing(int, TimeSpan?)
      • EnsureExactlyOnce(IExactlyOnceStrategy)
      • EnsureExactlyOnce(Action<IExactlyOnceStrategyBuilder>)
      • HandleTombstoneMessages()
      • IgnoreUnhandledMessages()
      • OnError(IErrorPolicy)
      • OnError(Action<IErrorPolicyBuilder>)
      • SkipNullMessages()
      • ThrowIfUnhandled()
      • UseLegacyNullMessageHandling()
      • WithSequenceTimeout(TimeSpan)
    • Implements
    • Extension Methods
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini