New to Kestra?
Use blueprints to kickstart your first workflows.
Use a Kestra Apache Pulsar RealtimeTrigger to push streaming events into MySQL message by message, with retries, lineage, and declarative YAML.
Stream events from an Apache Pulsar topic into a MySQL table the moment they arrive. This event-driven blueprint subscribes to a Pulsar topic and writes every consumed message into a relational table, giving you a low-latency ingestion path between your messaging layer and your operational database. It solves the common problem of bridging a high-throughput streaming system and a SQL store without standing up a separate stream-processing service or polling job.
realtime_trigger trigger of type io.kestra.plugin.pulsar.RealtimeTrigger subscribes to the Pulsar topic apache/pulsar/logs over pulsar://localhost:26650 using the subscription name kestra_trigger_sub. It fires one flow execution per message as events arrive.create_mysql_table task (io.kestra.plugin.jdbc.mysql.Query) runs an idempotent create table if not exists logs (...) statement so the target table is always present.insert_into_logs_table task (io.kestra.plugin.jdbc.mysql.Query) inserts the message payload, read from {{ trigger.value }}, into the logs table.Database connection details (url, username, password) are supplied once through pluginDefaults for the MySQL Query type.
Pulsar moves messages, but it does not orchestrate what happens to them. Kestra turns each message into a governed execution: the RealtimeTrigger reacts to events instead of polling, failed inserts can be retried declaratively, and every run is recorded with inputs, outputs, and logs for full lineage. The entire pipeline lives in version-controlled YAML, so the consumer logic, the table schema, and the connection defaults are reviewed and deployed like code rather than hidden inside a standalone consumer application.
uri.url.This blueprint does not reference any {{ secret('NAME') }} values. The MySQL credentials are set inline in pluginDefaults. For production, replace the inline username and password with secrets, for example {{ secret('MYSQL_USERNAME') }} and {{ secret('MYSQL_PASSWORD') }}.
bin/pulsar-admin tenants create apache, bin/pulsar-admin namespaces create apache/pulsar, then bin/pulsar-admin topics create-partitioned-topic apache/pulsar/logs -p 4.pluginDefaults connection values.bin/pulsar-client produce apache/pulsar/logs -m '--Hello World--' -n 1, then watch a new row appear in the logs table.topic, uri, and subscriptionName at your own Pulsar topic.message field.