> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/build/move/mode/stream.md).

# Streaming

Consume and land events continuously from Kafka or NATS with Nilus streaming.

Streaming movement runs a long-lived consumer that reads records from an event-streaming system in micro-batches and writes them to the sink. It processes records as they arrive, with no snapshot, cursor, or extraction window. Use it when the source is a message broker and events must land with minimal delay.

## When to use streaming

* The source is Apache Kafka or NATS JetStream.
* Events must be landed continuously, with minimal delay.
* The use case does not fit a scheduled batch window.
* You do not need transaction-log change capture; use [CDC](https://v2.dataos.info/build/move/mode/cdc.md) for that.

## Before you begin

Ensure you have:

* A source topic or subject reachable from DataOS.
* A Depot for the source broker, or an approved connection with secrets projected via `spec.use.projection`. NATS has no Depot, so it always uses a direct `nats+jetstream://` URI.
* A Depot for the destination, and a compute profile.

## 1. Choose your source

Streaming supports 2 brokers:

| Source         | Description                              |
| -------------- | ---------------------------------------- |
| Apache Kafka   | Topic-based event streams                |
| NATS JetStream | Subject-based persistent message streams |

For per-source options, see the [stream pipelines reference](https://v2.dataos.info/references/resources/nilus/stream/sample-configs) in References.

## 2. Write the manifest

Create a `nilus` resource with `spec.type: stream`:

```yaml
name: ${{pipeline-name}}
version: v1alpha
type: nilus
tags:
  - nilus-stream
description: ${{description}}
spec:
  type: stream
  compute: ${{compute-profile}}
  logLevel: INFO
  source:
    address: dataos://${{source-depot}}?purpose=rw
    options:
      source_table: "${{topic-or-stream}}"    # Kafka topic, or NATS JetStream stream name
      run_in_loop: true                       # keep consuming; without it, Nilus exits after the first pull
  sink:
    address: dataos://${{sink-depot}}?purpose=rw
    options:
      dest_table: ${{schema.table}}
      incremental_strategy: append
```

For NATS, set `source.address` to a direct `nats+jetstream://<host>:<port>?subject=<subject>` URI and project the credentials through `spec.use.projection`. The subject goes in the URI; `source_table` is the JetStream stream name. See [NATS](https://v2.dataos.info/references/resources/nilus/stream/stream-sources/nats) in References for the authentication forms and examples.

For the full attribute reference, see [stream configuration](https://v2.dataos.info/references/resources/nilus/stream/pipeline-config) in References.

## 3. Apply and confirm

```bash
dataos-ctl resource apply -f ${{path-to-manifest.yaml}}
dataos-ctl resource get -t nilus -n ${{pipeline-name}}
```

The pipeline runs continuously. Once events are landing, [explore the moved data](https://v2.dataos.info/build/move/explore-moved-data.md) to confirm records are arriving as expected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/build/move/mode/stream.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
