
Apache Pulsar Produce
CertifiedPublish messages to a Pulsar topic
Apache Pulsar Produce
Publish messages to a Pulsar topic
Reads records from Kestra storage or inline maps/lists and sends them with a Pulsar producer. Uses STRING serialization and no compression by default; Pulsar's shared producer mode applies unless another access mode is set.
type: io.kestra.plugin.pulsar.ProduceExamples
Read a CSV file, transform it to the right format, and publish it to Pulsar topic.
id: produce
namespace: company.team
inputs:
- type: FILE
id: file
tasks:
- id: csv_reader
type: io.kestra.plugin.serdes.csv.CsvToIon
from: "{{ inputs.file }}"
- id: file_transform
type: io.kestra.plugin.graalvm.js.FileTransform
from: "{{ outputs.csv_reader.uri }}"
script: |
var result = {
"key": row.id,
"value": {
"username": row.username,
"tweet": row.tweet
},
"eventTime": row.timestamp,
"properties": {
"key": "value"
}
};
row = result
- id: produce
type: io.kestra.plugin.pulsar.Produce
from: "{{ outputs.file_transform.uri }}"
uri: pulsar://localhost:26650
serializer: JSON
topic: test_kestra
Properties
from *RequiredNon-dynamicobject
Message source
Kestra internal storage URI, or map/list objects with optional key, value, eventTime, properties, deliverAt, deliverAfter, and sequenceId fields.
serializer *Requiredstring
STRINGSTRINGJSONBYTESSerializer for message value
Defaults to STRING. Choose a serializer compatible with consumers and topic schema.
topic *Requiredstring
Target Pulsar topic
uri *Requiredstring
Pulsar service URL
One or more Pulsar protocol URLs, e.g. pulsar://localhost: 6650 or pulsar://host1: 6650,host2: 6651. Use pulsar+ssl:// when enabling TLS.
accessMode string
SharedExclusiveExclusiveWithFencingWaitForExclusiveProducer access mode
Shared (default Pulsar behavior) allows multiple producers; Exclusive fails if another producer is connected; WaitForExclusive waits for exclusivity.
authenticationToken string
Authentication token
Token used when the broker requires token-based auth (e.g., hosted providers).
compressionType string
NONELZ4ZLIBZSTDSNAPPYProducer compression type
Default NONE. Other options: LZ4, ZLIB, ZSTD, SNAPPY. Use to reduce payload size at the cost of CPU.
encryptionKey string
Public encryption key
PEM-encoded key used to encrypt the data key for message payload encryption.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
producerName string
Custom producer name
Optional name reused on reconnects; may affect exclusive access checks.
producerProperties object
Producer properties
Key/value properties passed to the Pulsar producer builder.
schemaString string
Topic schema definition
JSON representation of the topic schema when schema enforcement is enabled.
schemaType string
NONENONEAVROJSONTopic schema type
One of NONE (default, no enforcement), AVRO, or JSON.
tlsOptions Non-dynamic
TLS options
Certificate/key material for TLS client authentication. Requires a pulsar+ssl:// URL.
io.kestra.plugin.pulsar.AbstractPulsarConnection-TlsOptions
CA certificate
Base64-encoded PEM of the trusted CA chain.
Client certificate
Base64-encoded PEM content for the client certificate.
Client key
Base64-encoded PEM private key matching the client certificate.
Outputs
messagesCount integer
Number of messages produced