For the complete documentation index, see llms.txt. This page is also available as Markdown.

Stream sample configs

Ready-to-use stream pipeline configurations for Kafka (plaintext, SASL/SSL, Confluent Cloud) and NATS+JetStream sources.

All examples below use the current Nilus pipeline shape with spec.type: stream:

type: nilus
spec:
  type: stream

Streaming pipelines pull records in micro-batches and write them to the configured sink. Tune batch_size and the per-source timeout (batch_timeout for Kafka, timeout for NATS) so the consumer fills batches without blocking the sink.

Always set run_in_loop: true under source.options for streaming services. Without it, Nilus exits after the first pull. Project secrets through spec.use.projection; never inline literal credentials in the URI.

Kafka

Plaintext development cluster
name: kafka-orders-stream-dev
version: v1alpha
type: nilus
spec:
  type: stream
  compute: universe-compute
  source:
    address: kafka://?bootstrap_servers=broker1:9092,broker2:9092&group_id=nilus-dev&batch_size=1000&batch_timeout=10
    options:
      source_table: orders
      run_in_loop: true
  sink:
    address: dataos://orderslakehouse?purpose=rw
    options:
      dest_table: analytics.orders_stream
      incremental_strategy: append
SASL_SSL with SCRAM-SHA-512
name: kafka-orders-stream-prod
version: v1alpha
type: nilus
spec:
  type: stream
  compute: universe-compute
  use:
    projection:
      secrets:
        - id: tenant:kafka-creds
          contextAlias: kafkaSecret
      projections:
        envVars:
          - key: KAFKA_USERNAME
            template: "{{ secrets['kafkaSecret'].username | base64_decode }}"
          - key: KAFKA_PASSWORD
            template: "{{ secrets['kafkaSecret'].password | base64_decode }}"
  source:
    address: kafka://?bootstrap_servers=broker.prod:9093&group_id=nilus-prod&security_protocol=SASL_SSL&sasl_mechanisms=SCRAM-SHA-512&sasl_username={KAFKA_USERNAME}&sasl_password={KAFKA_PASSWORD}&ssl_ca_location=/etc/dataos/secret/kafka-ca.pem&batch_size=2000&batch_timeout=10
    options:
      source_table: orders
      run_in_loop: true
  sink:
    address: dataos://orderslakehouse?purpose=rw
    options:
      dest_table: analytics.orders_stream
      incremental_strategy: append
Using Kafka depot
name: kafka-orders-stream-depot
version: v1alpha
type: nilus
spec:
  type: stream
  compute: universe-compute
  source:
    address: dataos://kafkadepot?purpose=rw&batch_size=1000&batch_timeout=10&group_id=nilus-prod
    options:
      source_table: orders
      run_in_loop: true
  sink:
    address: dataos://orderslakehouse?purpose=rw
    options:
      dest_table: analytics.orders_stream
      incremental_strategy: append

NATS+JetStream

Local server, no auth
Username/password with durable consumer

Validation notes

  • Use type: nilus and spec.type: stream for streaming connectors. Misclassifying a stream as spec.type: batch causes Nilus to run the pipeline once instead of staying connected.

  • Set run_in_loop: true under source.options so the consumer keeps pulling new batches.

  • Prefer incremental_strategy: append for streaming sinks. Use merge only when the destination has a stable primary key and you genuinely need deduplication.

  • Project all credentials through spec.use.projection. Never inline literal usernames, passwords, tokens, or NKeys seeds.

  • Keep batch_size aligned with what the sink can absorb in a single write; oversized batches cause back-pressure, undersized batches under-utilize the pipeline.

Last updated

Was this helpful?