Show / Hide Table of Contents

    Class ProducerEndpointBuilder<TEndpoint, TBuilder>

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

    Inheritance
    object
    EndpointBuilder<TEndpoint, TBuilder>
    ProducerEndpointBuilder<TEndpoint, TBuilder>
    KafkaProducerEndpointBuilder
    MqttProducerEndpointBuilder
    Implements
    IProducerEndpointBuilder<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 ProducerEndpointBuilder<TEndpoint, TBuilder> : EndpointBuilder<TEndpoint, TBuilder>, IProducerEndpointBuilder<TBuilder>, IEndpointBuilder<TBuilder> where TEndpoint : ProducerEndpoint where TBuilder : IProducerEndpointBuilder<TBuilder>
    Type Parameters
    Name Description
    TEndpoint

    The type of the endpoint being built.

    TBuilder

    The actual builder type.

    Constructors

    | Improve this doc View source

    ProducerEndpointBuilder(Type?, IEndpointsConfigurationBuilder?)

    Initializes a new instance of the ProducerEndpointBuilder<TEndpoint, TBuilder> class.

    Declaration
    protected ProducerEndpointBuilder(Type? messageType, IEndpointsConfigurationBuilder? endpointsConfigurationBuilder = null)
    Parameters
    Type Name Description
    Type messageType

    The type of the message being produced.

    IEndpointsConfigurationBuilder endpointsConfigurationBuilder

    The optional reference to the IEndpointsConfigurationBuilder that instantiated the builder.

    Methods

    | Improve this doc View source

    AddHeader(string, object?)

    Adds the specified header to all produced messages.

    Declaration
    public TBuilder AddHeader(string name, object? value)
    Parameters
    Type Name Description
    string name

    The header name.

    object value

    The header value.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    AddHeader<TMessage>(string, Func<IOutboundEnvelope<TMessage>, object?>)

    Adds the specified header to all produced messages of the specified type, using a value provider function to determine the header value for each message.

    Declaration
    public TBuilder AddHeader<TMessage>(string name, Func<IOutboundEnvelope<TMessage>, object?> valueProvider) where TMessage : class
    Parameters
    Type Name Description
    string name

    The header name.

    Func<IOutboundEnvelope<TMessage>, object> valueProvider

    The value provider function.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages to be enriched with this header.

    | Improve this doc View source

    AddHeader<TMessage>(string, object?)

    Adds the specified header to all produced messages of the specified type.

    Declaration
    public TBuilder AddHeader<TMessage>(string name, object? value) where TMessage : class
    Parameters
    Type Name Description
    string name

    The header name.

    object value

    The header value.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages to be enriched with this header.

    | 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

    EnableChunking(int, bool)

    Enables chunking, splitting the larger messages into smaller chunks.

    Declaration
    public TBuilder EnableChunking(int chunkSize, bool alwaysAddHeaders = true)
    Parameters
    Type Name Description
    int chunkSize

    The maximum chunk size in bytes.

    bool alwaysAddHeaders

    A value indicating whether the x-chunk-index and related headers have to be added to the produced message in any case, even if its size doesn't exceed the single chunk size. The default is true.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    Encrypt(EncryptionSettings)

    Specifies the EncryptionSettings to be used to encrypt the messages.

    Declaration
    public TBuilder Encrypt(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

    ProduceDirectly()

    Specifies that the Silverback.Messaging.Outbound.DefaultProduceStrategy has to be used, producing directly to the message broker.

    Declaration
    public TBuilder ProduceDirectly()
    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    ProduceToOutbox()

    Specifies that theOutboxProduceStrategy has to be used, storing the messages into the transactional outbox table. The operation is therefore included in the database transaction applying the message side effects to the local database. The IOutboxWorker takes care of asynchronously sending the messages to the message broker.

    Declaration
    public TBuilder ProduceToOutbox()
    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    SerializeUsing(IMessageSerializer)

    Specifies the IMessageSerializer to be used to serialize the messages.

    Declaration
    public TBuilder SerializeUsing(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

    UseStrategy(IProduceStrategy)

    Specifies the strategy to be used to produce the messages.

    Declaration
    public TBuilder UseStrategy(IProduceStrategy strategy)
    Parameters
    Type Name Description
    IProduceStrategy strategy

    The IProduceStrategy.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    | Improve this doc View source

    WithMessageId<TMessage>(Func<IOutboundEnvelope<TMessage>, object?>)

    Uses the specified value provider function to set the message id header for each produced message.

    Declaration
    public TBuilder WithMessageId<TMessage>(Func<IOutboundEnvelope<TMessage>, object?> valueProvider) where TMessage : class
    Parameters
    Type Name Description
    Func<IOutboundEnvelope<TMessage>, object> valueProvider

    The value provider function.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages to be enriched with this header.

    Implements

    IProducerEndpointBuilder<TBuilder>
    IEndpointBuilder<TBuilder>

    Extension Methods

    ProducerEndpointBuilderEncryptUsingExtensions.EncryptUsingAes<TBuilder>(IProducerEndpointBuilder<TBuilder>, byte[], byte[]?)
    ProducerEndpointBuilderEncryptUsingExtensions.EncryptUsingAes<TBuilder>(IProducerEndpointBuilder<TBuilder>, byte[], string, byte[]?)
    ProducerEndpointBuilderProduceBinaryFilesExtensions.ProduceBinaryFiles<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<IBinaryFileMessageSerializerBuilder>?)
    ProducerEndpointBuilderSerializeAsJsonExtensions.SerializeAsJson<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<IJsonMessageSerializerBuilder>?)
    ProducerEndpointBuilderSerializeAsJsonUsingNewtonsoftExtensions.SerializeAsJsonUsingNewtonsoft<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<INewtonsoftJsonMessageSerializerBuilder>?)
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini