Produce
Kafka produce operation.
Task version: 3.0.0
Required Frends version: 5.7+
Required .NET version: 8.0
Compatible Agents: Crossplatform
Source code: https://github.com/FrendsPlatform/Frends.Kafka
Task Parameters
Host : String
Initial list of brokers as a CSV list of broker host or host:port.
Default: -
Example: localhost:1234
Topic : String
Topic.
Default: -
Example: ExampleTopic
Key : String
Message key value.
Can be empty.
Default: -
Example: examplekey
Message : String
Message.
Can be empty.
Default: -
Example: Example message.
Partition : Int32
The partition value.
If set to -1. The partition the message is sent to is determined by the partitioner defined using the Options.Partitioner configuration property.
Default: 0
Example: 0
CompressionType : CompressionTypes
Compression codec to use for compressing message sets.
Possible values:
None: No compression.Gzip: Gzip compression.Snappy: Snappy compression.Lz4: LZ4 compression.Zstd: Zstandard compression.
Default: None
Example: CompressionTypes.None
SecurityProtocol : SecurityProtocols
Protocol used to communicate with brokers.
Possible values:
Plaintext: Unencrypted communication without authentication.Ssl: Encrypted communication using SSL.SaslPlaintext: SASL authentication over an unencrypted connection.SaslSsl: SASL authentication over an SSL encrypted connection.
Default: Plaintext
Example: SecurityProtocols.Plaintext
Socket : Socket
Socket parameters.
Default: -
Example: Socket { int SocketTimeoutMs }
Socket.SocketKeepaliveEnable : Boolean
Enable TCP keep-alives (SO_KEEPALIVE) on broker sockets.
Default: False
Example: false
Socket.SocketNagleDisable : Boolean
Disable the Nagle algorithm (TCP_NODELAY) on broker sockets.
Default: False
Example: false
Socket.SocketTimeoutMs : Int32
Default timeout for network requests.
ProduceRequests will use the lesser value of Socket.SocketTimeoutMs and remaining Options.MessageTimeoutMs for the first message in the batch.
Default: 60000
Example: 60000
Socket.SocketConnectionSetupTimeoutMs : Int32
Maximum time allowed for broker connection setup (TCP connection setup as well SSL and SASL handshake).
If the connection to the broker is not fully functional after this the connection will be closed and retried.
Default: 30000
Example: 30000
Socket.SocketMaxFails : Int32
Disconnect from broker when this number of Produce failures (e.g., timed out requests) is reached.
Disable with 0.
WARNING: It is highly recommended to leave this setting at its default value of 1 to avoid the client and broker to become desynchronized in case of request timeouts.
NOTE: The connection is automatically re-established.
Default: 1
Example: 1
Socket.SocketReceiveBufferBytes : Int32
Broker socket receive buffer size.
0 = System default.
Default: 0
Example: 0
Sasl : Sasl
SASL parameters.
Default: -
Example: Sasl { bool UseSasl }
Sasl.UseSasl : Boolean
Use SASL.
Default: False
Example: false
Sasl.SaslMechanism : SaslMechanisms
SASL mechanism to use for authentication.
Possible values:
Gssapi: GSSAPI (Kerberos) mechanism.Plain: Plain username and password mechanism.ScramSha256: SCRAM-SHA-256 mechanism.ScramSha512: SCRAM-SHA-512 mechanism.OAuthBearer: OAUTHBEARER mechanism.
Default: Plain
Example: SaslMechanisms.Plain
Sasl.SaslUsername : String
SASL username for use with the PLAIN, ScramSha256 or ScramSha512 mechanism.
Default: -
Example: ExampleUser
🗝Sasl.SaslPassword : String
SASL password for use with the PLAIN, ScramSha256 or ScramSha512 mechanism.
Default: -
Example: ExamplePassword
Sasl.SaslOauthbearerMethod : SaslOauthbearerMethods
Set to "default" or "oidc" to control which login method to be used.
If set to "oidc", the following properties must also be be specified:
Sasl.SaslOauthbearerClientId,
Sasl.SaslOauthbearerClientSecret,
Sasl.SaslOauthbearerTokenEndpointUrl.
Possible values:
Default: Default OAuth bearer method.Oidc: OpenID Connect OAuth bearer method.
Default: Default
Example: SaslOauthbearerMethod.Default
Sasl.SaslOauthbearerClientId : String
Public identifier for the application.
Must be unique across all clients that the authorization server handles.
Default: -
Example: ExampleClient
🗝Sasl.SaslOauthbearerClientSecret : String
Client secret only known to the application and the authorization server.
Default: -
Example: ExampleSecret
Sasl.SaslOauthbearerTokenEndpointUrl : String
OAuth/OIDC issuer token endpoint HTTP(S) URI used to retrieve token.
Default: -
Example: ExampleURL
Sasl.SaslOauthbearerExtensions : String
Allow additional information to be provided to the broker.
Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea".
Default: -
Example: supportFeatureX=true,organizationId=sales-emea
Sasl.SaslOauthbearerScope : String
Client use this to specify the scope of the access request to the broker.
Default: -
Example: ExampleScope
Sasl.SaslOauthbearerConfig : String
SASL/OAUTHBEARER configuration.
Default: -
Example: principal=admin extension_traceId=123
Sasl.SaslKerberosKeytab : String
Path to Kerberos keytab file.
Only supported on Linux OS.
Default: -
Example: /path/to/your/file
Sasl.SaslKerberosMinTimeBeforeRelogin : Int32
Minimum time in milliseconds between key refresh attempts.
Disable automatic key refresh by setting this property to 0.
Only supported on Linux OS.
Default: -
Example: 60000
Sasl.SaslKerberosPrincipal : String
This client's Kerberos principal name.
Only supported on Linux OS.
Default: -
Example: kafkaclient
Sasl.SaslKerberosServiceName : String
Kerberos principal name that Kafka runs as, not including /hostname@REALM
Only supported on Linux OS.
Default: -
Example: kafka
Ssl : Ssl
SSL parameters.
Default: -
Example: Ssl { bool UseSsl }
Ssl.UseSsl : Boolean
Use SSL.
Default: False
Example: false
Ssl.SslEndpointIdentificationAlgorithm : SslEndpointIdentificationAlgorithms
Endpoint identification algorithm to validate broker hostname using broker certificate.
https - Server (broker) hostname verification as specified in RFC2818.
none - No endpoint verification.
OpenSSL >= 1.0.2 required.
Possible values:
None: Value is not set.Https: Server hostname is verified against the certificate using HTTPS rules.
Default: None
Example: SslEndpointIdentificationAlgorithm.None
Ssl.EnableSslCertificateVerification : Boolean
Enable OpenSSL's builtin broker (server) certificate verification.
Default: True
Example: true
Ssl.SslCertificateLocation : String
Path to client's public key (PEM) used for authentication.
Default: -
Example: /path/to/your/file
Ssl.SslCaLocation : String
File or directory path to CA certificate(s) for verifying the broker's key.
Default: -
Example: Root
Ssl.SslKeyLocation : String
Path to client's private key (PEM) used for authentication.
Default: -
Example: /path/to/your/file
Ssl.SslKeystoreLocation : String
Path to client's keystore (PKCS#12) used for authentication.
Default: -
Example: /path/to/your/file
Ssl.SslEngineLocation : String
Path to OpenSSL engine library.
OpenSSL >= 1.1.0 required.
Default: -
Example: /path/to/your/file
Ssl.SslCrlLocation : String
Path to CRL for verifying broker's certificate validity.
Default: -
Example: /path/to/your/file
🗝Ssl.SslCertificatePem : String
Client's public key string (PEM format) used for authentication.
Default: -
Example: —–BEGIN PRIVATE KEY—–MIIES42Cg6zn—–END PRIVATE KEY—–
🗝Ssl.SslCaPem : String
A certificate string (PEM format) for verifying the broker's key.
Default: -
Example: —–BEGIN PRIVATE KEY—–MIIES42Cg6zn—–END PRIVATE KEY—–
🗝Ssl.SslKeyPem : String
Client's private key string (PEM format) used for authentication.
Default: -
Example: —–BEGIN PRIVATE KEY—–MIIES42Cg6zn—–END PRIVATE KEY—–
Ssl.SslCaCertificateStores : String
Comma-separated list of Windows Certificate stores to load CA certificates from.
Certificates will be loaded in the same order as stores are specified.
If no certificates can be loaded from any of the specified stores an error is logged and the OpenSSL library's default CA location is used instead.
Default: Root
Example: Root
🗝Ssl.SslKeystorePassword : String
Client's keystore (PKCS#12) password.
Default: -
Example: ExamplePassword
🗝Ssl.SslKeyPassword : String
Private key passphrase for use with Ssl.SslKeyLocation)
Default: -
Example: ExamplePassword
Ssl.SslCipherSuites : String
A cipher suite is a named combination of authentication, encryption, MAC and key exchange algorithm used to negotiate the security settings for a network connection using TLS or SSL network protocol.
Default: -
Example: foo
Ssl.SslCurvesList : String
The supported-curves extension in the TLS ClientHello message specifies the curves (standard/named, or 'explicit' GF(2^k) or GF(p)) the client is willing to have the server use.
Default: -
Example: 1
Ssl.SslSigalgsList : String
The client uses the TLS ClientHello signature_algorithms extension to indicate to the server which signature/hash algorithm pairs may be used in digital signatures.
Default: -
Example: 1
SchemaRegistry : SchemaRegistry
Schema registry parameters.
Default: -
Example: SchemaRegistry { bool UseSchemaRegistry }
SchemaRegistry.UseSchemaRegistry : Boolean
Use Avro schema registry.
Default: False
Example: false
SchemaRegistry.SchemaRegistryUrl : String
A comma-separated list of URLs for schema registry instances that are used to register or lookup schemas.
Default: -
Example: http://localhost:8081
SchemaRegistry.BasicAuthCredentialsSource : AuthCredentialsSources
Authentication credentials source.
UserInfo = Credentials are specified via the BasicAuthUserInfo property in the form username:password. If BasicAuthUserInfo is not set, authentication is disabled.
SaslInherit = Credentials are specified via the Sasl.SaslUsername and Sasl.SaslPassword parameters.
Possible values:
UserInfo: Credentials are specified via theschema.registry.basic.auth.user.infoconfig property in the form username:password. Ifschema.registry.basic.auth.user.infois not set, authentication is disabled.SaslInherit: Credentials are specified via thesasl.usernameandsasl.passwordconfiguration properties.
Default: UserInfo
Example: AuthCredentialsSource.UserInfo
🗝SchemaRegistry.BasicAuthUserInfo : String
Basic auth credentials in the form {username}:{password}.
Default: -
Example: foo:bar
SchemaRegistry.EnableSslCertificateVerification : Boolean
Enable SSL verification.
Disabling SSL verification is insecure and should only be done for reasons of convenience in test/dev environments.
Default: True
Example: true
SchemaRegistry.MaxCachedSchemas : Int32
Specifies the maximum number of schemas CachedSchemaRegistryClient should cache locally.
Default: 1000
Example: 1000
SchemaRegistry.RequestTimeoutMs : Int32
Specifies the timeout for requests to Confluent Schema Registry.
Default: 30000
Example: 30000
SchemaRegistry.SslCaLocation : String
File path to CA certificate(s) for verifying the Schema Registry's key.
System CA certs will be used if not specified.
Default: -
Example: /path/to/your/file
SchemaRegistry.SslKeystoreLocation : String
SSL keystore (PKCS#12) location.
Default: -
Example: /path/to/your/file
SchemaRegistry.SslKeystorePassword : String
SSL keystore (PKCS#12) password.
Default: -
Example: foo
SchemaRegistry.SchemaJson : String
Schema JSON.
Default: -
Example: { "fields": [ { "name": "intField", "type": "int" }, { "name": "longField", "type": "long" }, { "name": "floatField", "type": "float" }, { "name": "doubleField", "type": "double" }, { "name": "booleanField", "type": "boolean" }, { "name": "stringField", "type": "string" }, { "name": "nullField", "type": "null" }, { "name": "bytesField", "type": "bytes" }, { "name": "enumField", "type": { "name": "Colors", "symbols": [ "RED", "GREEN", "BLUE" ], "type": "enum" } }, { "name": "arrayField", "type": { "items": "string", "type": "array" } }, { "name": "mapField", "type": { "type": "map", "values": "int" } }, { "name": "fixedField", "type": { "name": "FourBytes", "size": 4, "type": "fixed" } }, { "name": "unionField", "type": [ "null", "string" ] }, { "name": "recordField", "type": { "fields": [ { "name": "nestedField", "type": "string" } ], "name": "NestedRecord", "type": "record" } } ], "name": "sampleRecord", "namespace": "com.mycorp.mynamespace", "type": "record" }
SchemaRegistry.Records : String
Field values as an JSON array.
Default: -
Example: { "intField": 123, "longField": 1234567890, "floatField": 1.23, "doubleField": 1.23456789, "booleanField": true, "stringField": "Hello, World!", "nullField": null, "bytesField": "dGVzdDE=", "enumField": "RED", "arrayField": ["item1", "item2", "item3"], "mapField": { "key1": 1, "key2": 2, "key3": 3 }, "fixedField": "YWJjZA==", "unionField": "Hello, Union!", "recordField": { "nestedField": "Hello, Nested!" } }
Acks : Ack
This field indicates the number of acknowledgements the leader broker must receive from ISR brokers before responding to the request.
Possible values:
None: Broker does not Produce any response/ack to client.Leader: The leader will write the record to its local log but will respond without awaiting full acknowledgement from all followers.All: Broker will block until message is committed by all in sync replicas (ISRs).
Default: None
Example: Ack.None
EnableIdempotence : Boolean
When set to true, the producer will ensure that messages are successfully produced exactly once and in the original produce order.
The following configuration properties are adjusted automatically (if not modified by the user) when idempotence is enabled:
Options.MaxInFlight=5 (must be less than or equal to 5),
Options.MessageProduceMaxRetries=2147483647 (must be greater than 0),
Options.Ack.All,
Producer instantation will fail if user-supplied configuration is incompatible.
Default: False
Example: false
LingerMs : Int32
Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers.
A higher value allows larger and more effective (less overhead, improved compression) batches of messages to accumulate at the expense of increased message delivery latency.
Default: 5
Example: 5
MaxInFlight : Int32
Maximum number of in-flight requests per broker connection.
This is a generic property applied to all broker communication, however it is primarily relevant to produce requests.
In particular, note that other mechanisms limit the number of outstanding consumer fetch request per broker to one.
Default: 1000000
Example: 1000000
MessageTimeoutMs : Int32
Local message timeout. This value is only enforced locally and limits the time a produced message waits for successful delivery. A time of 0 is infinite.
This is the maximum time librdkafka may use to deliver a message (including retries).
Delivery error occurs when either the retry count or the message timeout are exceeded.
The message timeout is automatically adjusted to TransactionTimeoutMs if Options.TransactionalId is configured.
Default: 300000
Example: 300000
MessageMaxBytes : Int32
Maximum Kafka protocol request message size.
Due to differing framing overhead between protocol versions the producer is unable to reliably enforce a strict max message limit at produce time and may exceed the maximum size by one message in protocol ProduceRequests, the broker will enforce the the topic's Options.MessageMaxBytes limit (see Apache Kafka documentation)
Default: 1000000
Example: 1000000
MessageSendMaxRetries : Int32
How many times to retry sending a failing Message.
Retrying may cause reordering unless Options.EnableIdempotence is set to true.
Default: 2147483647
Example: 5
Partitioner : Partitioners
Partitioner.
Possible values:
Random: Random distribution.Consistent: CRC32 hash of key (Empty and NULL keys are mapped to single partition).ConsistentRandom: CRC32 hash of key (Empty and NULL keys are randomly partitioned).Murmur2: Java Producer compatible Murmur2 hash of key (NULL keys are mapped to single partition)Murmur2Random: Java Producer compatible Murmur2 hash of key (NULL keys are randomly partitioned. This is functionally equivalent to the default partitioner in the Java Producer.)
Default: ConsistentRandom
Example: Partitioners.ConsistentRandom
QueueBufferingMaxKbytes : Int32
Maximum total message size sum allowed on the producer queue.
This queue is shared by all topics and partitions.
This property has higher priority than Options.QueueBufferingMaxMessages.
Default: 1048576
Example: 1048576
QueueBufferingMaxMessages : Int32
Maximum number of messages allowed on the producer queue. This queue is shared by all topics and partitions.
Default: 100000
Example: 100000
TransactionalId : String
Enables the transactional producer.
Used to identify the same transactional producer instance across process restarts.
It allows the producer to guarantee that transactions corresponding to earlier instances of the same producer have been finalized prior to starting any new transactions, and that any zombie instances are fenced off.
If no TransactionalId is provided, then the producer is limited to idempotent delivery (if Options.EnableIdempotence is set). Requires broker version >= 0.11.0.
Default: -
Example: 1
TransactionTimeoutMs : Int32
The maximum amount of time in milliseconds that the transaction coordinator will wait for a transaction status update from the producer before proactively aborting the ongoing transaction.
If this value is larger than the transaction.max.timeout.ms setting in the broker, the call will fail with Timeout error.
The transaction timeout automatically adjusts Options.MessageTimeoutMs and Socket.SocketTimeoutMs, unless explicitly configured in which case they must not exceed the transaction timeout (Socket.SocketTimeoutMs must be at least 100ms lower than Options.TransactionTimeoutMs).
This is also the default timeout value if no timeout (-1) is supplied to the transactional API methods.
Default: 60000
Example: 60000
Debug : String
A comma-separated list of debug contexts to enable.
Detailed Producer debugging: broker,topic,msg.
Default: -
Example: broker
ThrowErrorOnFailure : Boolean
Whether to throw an error on failure.
Default: True
Example: true
ErrorMessageOnFailure : String
Overrides the error message on failure.
Default: -
Example: Failed to produce message to Kafka
Task Result
Success : Boolean
True if message was produced successfully.
Example: true
Data : Object
Produce result.
Example: PossiblyPersisted
Error : Error
Error that occurred during task execution.
Example: object { string Message, Exception AdditionalInfo }
Error.Message : String
Summary of the error.
Example: Local: Message timed out
Error.AdditionalInfo : Exception
Additional information about the error.
Example: object { Exception AdditionalInfo }
Task Changelog
Changelog for Task Frends.Kafka.Produce.
Changelog
[3.0.0] - 2026-10-27
Changed
[Breaking Change] Socket, Sasl, Ssl and SchemaRegistry parameters are now properties of the new Connection parameter. The Task now has the parameters Input, Connection and Options.
Task now targets .NET 8.
Added
Options.ThrowErrorOnFailure and Options.ErrorMessageOnFailure for controlling error handling. When ThrowErrorOnFailure is false, failures are returned in Result.Error.
Result.Error property containing the error message and additional information.
Fixed
Added missing documentation example for Options.MessageSendMaxRetries.
[2.1.0] - 2026-07-15
Fixed
Ssl.SslCaCertificateStores is no longer set when the parameter is empty, so SSL connections work on Linux agents. The property is Windows-only in librdkafka.
[2.0.0] - 2024-05-14
Added
Support for Confluent Schema Registry based Avro.
New parameter Options.Debug.
Changed
Result.Status and Result.Timestamp have been replaced by Result.Data.
Changed how partitions are handled when producing message. See Input.Partition description.
All but Kerberos SASL settings can be used on Windows platform.
Confluent.Kafka updated from version 1.9.3 to 2.4.
Parameter removed: Options.ApiVersionRequest.
[1.2.0] - 2023-10-11
Changed
Input.Message will no longer be serialized into JSON text before sending.
[1.1.0] - 2023-09-01
Added
Input.Partition, set the partition.
Input.Key, set message key.
[1.0.1] - 2023-04-04
Fixed
Changed Task to set ssl.SslCaCertificateStores only if it's set as parameter.
[1.0.0] - 2022-10-19
Added
Initial implementation
Last updated
Was this helpful?

