> ## Documentation Index
> Fetch the complete documentation index at: https://www.orionjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrading to v5

> How to upgrade an Orionjs v4 application to v5

Without the optional Rust host, Orionjs v5 runs the same way as v4. Most applications only need to
update their `@orion-js/*` dependencies and make sure Echoes uses Pulse instead of Kafka.

> [!NOTE]
>
> Looking for Orionjs v4 documentation? Select **v4** in the version switcher at the top of the
> docs.

## 1. Move Echoes off Kafka (breaking change)

Orionjs v5 removes the Kafka transport from `@orion-js/echoes`. [Pulse](https://www.orionjs.com/overview/other-modules/pulse/introduction.md)
is now the only event transport.

The following Echoes options and entrypoints were removed:

* Top-level `client`, `producer`, and `consumer` options on `startService()`
* `events.kafka`, `events.consumeFrom`, and `events.publishTo`
* The `onMessage` entrypoint
* `acks` and `timeout` options on `publish()`

### If you already use Pulse

Remove `consumeFrom` and `publishTo` from `events`, keeping `events.pulse`:

```ts theme={null}
// Before (v4)
await startService({
  echoes,
  requests: {key: env.echoes_password, services},
  events: {
    pulse: {connectionString: env.mongo_url, consumerGroup: 'my-service'},
    consumeFrom: ['pulse'],
    publishTo: 'pulse',
  },
})

// After (v5)
await startService({
  echoes,
  requests: {key: env.echoes_password, services},
  events: {
    pulse: {connectionString: env.mongo_url, consumerGroup: 'my-service'},
  },
})
```

Remove `kafkajs` from your `package.json` if nothing else uses it, and check `publish()` calls for
removed `acks` or `timeout` options.

### If you still use Kafka

Migrate to Pulse **on Orionjs v4 first**, where Echoes can consume from Kafka and Pulse at the same
time while publishers switch over. Follow the
[v4 incremental Kafka-to-Pulse migration guide](https://www.orionjs.com/v4/overview/controllers/echoes.md#incremental-migration-from-kafka-to-pulse),
then upgrade to v5 once Kafka consumption is removed.

## 2. Upgrade `@orion-js/*` packages to `5.0.0`

All `@orion-js/*` npm packages are versioned together at `5.0.0`. Update every `@orion-js/*` package
in your `package.json` to `^5.0.0` so packages inside the same process stay aligned:

```bash theme={null}
bun update
```

Run type-checking, build, and tests:

```bash theme={null}
bunx orion check
bun test
```

## 3. Deploy safely alongside v4

Everything other than Kafka is wire- and storage-compatible with v4:

* **Echoes requests** (`/echoes-services`) use the same signature and serialization format, so v4
  and v5 services can call each other.
* **Jobs** (`@orion-js/dogs`) use the same MongoDB collections (`orionjs.jobs_dogs_records` and
  `orionjs.jobs_dogs_history`) and claim protocol.
* **Pulse** (`@orion-js/pulse`) uses the same collections, leases, and delivery states.

v4 workers and v5 instances (with or without the Rust host) can share job queues and Pulse consumer
groups during a rolling deploy.

## 4. Optionally adopt the Rust host

Once your app is running on v5, you can put the `orionrs` Rust host in front of it and move HTTP
routes, jobs, and echoes to Rust one at a time. See the [Orion v5 guide](https://www.orionjs.com/guides/v5.md) to get
started.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.