Show / Hide Table of Contents

    Class KafkaProducerEndpoint

    Represents a topic to produce to.

    Inheritance
    System.Object
    Endpoint
    ProducerEndpoint
    KafkaProducerEndpoint
    Implements
    IProducerEndpoint
    IEndpoint
    System.IEquatable<KafkaProducerEndpoint>
    Inherited Members
    ProducerEndpoint.Chunk
    ProducerEndpoint.Strategy
    ProducerEndpoint.MessageEnrichers
    ProducerEndpoint.IProducerEndpoint.MessageEnrichers
    ProducerEndpoint.GetActualName(IOutboundEnvelope, IServiceProvider)
    ProducerEndpoint.BaseEquals(Endpoint)
    Endpoint.DefaultSerializer
    Endpoint.DisplayName
    Endpoint.Name
    Endpoint.FriendlyName
    Endpoint.Serializer
    Endpoint.Encryption
    Endpoint.MessageValidationMode
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Silverback.Messaging
    Assembly: Silverback.Integration.Kafka.dll
    Syntax
    public sealed class KafkaProducerEndpoint : ProducerEndpoint, IProducerEndpoint, IEndpoint, IEquatable<KafkaProducerEndpoint>

    Constructors

    | Improve this doc View source

    KafkaProducerEndpoint(Func<IOutboundEnvelope, IServiceProvider, String>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(Func<IOutboundEnvelope, IServiceProvider, string> nameFunction, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.Func<IOutboundEnvelope, System.IServiceProvider, System.String> nameFunction

    The function returning the endpoint name for the message being produced.

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(Func<IOutboundEnvelope, IServiceProvider, String>, Func<IOutboundEnvelope, IServiceProvider, Int32>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(Func<IOutboundEnvelope, IServiceProvider, string> nameFunction, Func<IOutboundEnvelope, IServiceProvider, int> partitionFunction, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.Func<IOutboundEnvelope, System.IServiceProvider, System.String> nameFunction

    The function returning the endpoint name for the message being produced.

    System.Func<IOutboundEnvelope, System.IServiceProvider, System.Int32> partitionFunction

    The optional function returning the target partition index for the message being produced. If null the partition is automatically derived from the message key (use KafkaKeyMemberAttribute to specify a message key, otherwise a random one will be generated).

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(Func<IOutboundEnvelope, String>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(Func<IOutboundEnvelope, string> nameFunction, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.Func<IOutboundEnvelope, System.String> nameFunction

    The function returning the endpoint name for the message being produced.

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(Func<IOutboundEnvelope, String>, Func<IOutboundEnvelope, Int32>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(Func<IOutboundEnvelope, string> nameFunction, Func<IOutboundEnvelope, int> partitionFunction, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.Func<IOutboundEnvelope, System.String> nameFunction

    The function returning the endpoint name for the message being produced.

    System.Func<IOutboundEnvelope, System.Int32> partitionFunction

    The optional function returning the target partition index for the message being produced. If null the partition is automatically derived from the message key (use KafkaKeyMemberAttribute to specify a message key, otherwise a random one will be generated).

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(String, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(string name, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.String name

    The name of the topic.

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(String, Func<IOutboundEnvelope, String[]>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(string nameFormat, Func<IOutboundEnvelope, string[]> argumentsFunction, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.String nameFormat

    The endpoint name format string that will be combined with the arguments returned by the argumentsFunction using a string.Format.

    System.Func<IOutboundEnvelope, System.String[]> argumentsFunction

    The function returning the arguments to be used to format the string.

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(String, Func<IOutboundEnvelope, String[]>, Func<IOutboundEnvelope, Int32>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(string nameFormat, Func<IOutboundEnvelope, string[]> argumentsFunction, Func<IOutboundEnvelope, int> partitionFunction, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.String nameFormat

    The endpoint name format string that will be combined with the arguments returned by the argumentsFunction using a string.Format.

    System.Func<IOutboundEnvelope, System.String[]> argumentsFunction

    The function returning the arguments to be used to format the string.

    System.Func<IOutboundEnvelope, System.Int32> partitionFunction

    The optional function returning the target partition index for the message being produced. If null the partition is automatically derived from the message key (use KafkaKeyMemberAttribute to specify a message key, otherwise a random one will be generated).

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(String, Nullable<Int32>, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(string name, int? partition, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.String name

    The name of the topic.

    System.Nullable<System.Int32> partition

    The optional partition index. If null the partition is automatically derived from the message key (use KafkaKeyMemberAttribute to specify a message key, otherwise a random one will be generated).

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    | Improve this doc View source

    KafkaProducerEndpoint(Type, KafkaClientConfig)

    Initializes a new instance of the KafkaProducerEndpoint class.

    Declaration
    public KafkaProducerEndpoint(Type nameResolverType, KafkaClientConfig clientConfig = null)
    Parameters
    Type Name Description
    System.Type nameResolverType

    The type of the IKafkaProducerEndpointNameResolver to be used to resolve the actual endpoint name.

    KafkaClientConfig clientConfig

    The KafkaClientConfig to be used to initialize the KafkaProducerConfig.

    Properties

    | Improve this doc View source

    Configuration

    Gets or sets the Kafka client configuration. This is actually an extension of the configuration dictionary provided by the Confluent.Kafka library.

    Declaration
    public KafkaProducerConfig Configuration { get; set; }
    Property Value
    Type Description
    KafkaProducerConfig

    Methods

    | Improve this doc View source

    Equals(KafkaProducerEndpoint)

    Declaration
    public bool Equals(KafkaProducerEndpoint other)
    Parameters
    Type Name Description
    KafkaProducerEndpoint other
    Returns
    Type Description
    System.Boolean
    | Improve this doc View source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)
    | Improve this doc View source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()
    | Improve this doc View source

    GetPartition(IOutboundEnvelope, IServiceProvider)

    Gets the target partition. When set to Partition.Any (-1) the partition is automatically derived from the message key (use KafkaKeyMemberAttribute to specify a message key, otherwise a random one will be generated). The default is Partition.Any (-1).

    Declaration
    public Partition GetPartition(IOutboundEnvelope envelope, IServiceProvider serviceProvider)
    Parameters
    Type Name Description
    IOutboundEnvelope envelope

    The envelope containing the message being produced.

    System.IServiceProvider serviceProvider

    The System.IServiceProvider in the current scope.

    Returns
    Type Description
    Confluent.Kafka.Partition

    The partition to be produced to.

    | Improve this doc View source

    Validate()

    Validates the endpoint configuration and throws an EndpointConfigurationException if not valid.

    Declaration
    public override void Validate()
    Overrides
    ProducerEndpoint.Validate()

    Implements

    IProducerEndpoint
    IEndpoint
    System.IEquatable<T>
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini