> Markdown version of [Session Replication with Kubernetes Kit](https://vaadin.com/docs/latest/tools/collaboration/advanced/serialization). Section index: [llms.txt](https://vaadin.com/docs/latest/tools/llms.txt)

# Kubernetes Kit Session Replication (deprecated since V25.3)

> **Warning:** Collaboration Kit is superseded by [signals](https://vaadin.com/docs/latest/flow/ui-state/shared-signals.md) and is scheduled for removal in Vaadin 26.
>
> See [Migrating from Collaboration Kit to Signals](https://vaadin.com/docs/latest/tools/collaboration/migrating-to-signals.md) for how.

[Kubernetes Kit](https://vaadin.com/docs/latest/tools/kubernetes.md) allows session replication by transferring HTTP session data via a backend session storage for every request. This requires that everything stored in the session is made serializable. The Kubernetes Kit documentation provides some general [session replication tips](https://vaadin.com/docs/latest/tools/kubernetes/session-replication.md#session-replication-tips). However, when using Collaboration Kit, there are some specific changes you may need to make.

## <a id="collaboration-kit-classes"></a>Collaboration Kit Classes

An instance of the class `CollaborationEngine` should not be stored in the session. Don’t work directly with the `CollaborationEngine` class. Instead, utilize other APIs, such as [`Topic`](https://vaadin.com/docs/latest/tools/collaboration/advanced/topic-api.md), [`CollaborationBinder`](https://vaadin.com/docs/latest/tools/collaboration/components/collaboration-binder.md) and the [managers](https://vaadin.com/docs/latest/tools/collaboration/managers.md). If you must work directly with the class, it should always be accessed using its singleton method:

`ConnectionContextExample.java`

```java
ComponentConnectionContext context = new ComponentConnectionContext(
        this);

// In this case the CollaborationEngine instance
// also needs to be supplied.
messageManager = new MessageManager(context, localUser, topicId,
        CollaborationEngine::getInstance);

registration = CollaborationEngine.getInstance().openTopicConnection(
        context, topicId, localUser, connectionActivationCallback);
```

> **Note:** The `MessageManager` constructor now takes a static method reference as its last argument. Previously, this took an instance of `CollaborationEngine`. This version of the constructor has now been deprecated, so you should also update this in your code.

Here is a list of other Collaboration Kit classes that should not be stored in the session:

| Class               | Alternative                                                   |
| ------------------- | ------------------------------------------------------------- |
| `CollaborationList` | Use `topic.getNamedList()`                                    |
| `CollaborationMap`  | Use `topic.getNamedMap()`                                     |
| `TopicConnection`   | Use `CollaborationEngine.getInstance().openTopicConnection()` |

Conversely, here is a list of Collaboration Kit classes that are serializable and can be stored in the session:

| Class                        |
| ---------------------------- |
| `CollaborationAvatarGroup`   |
| `CollaborationBinder`        |
| `CollaborationMessage`       |
| `CollaborationMessageInput`  |
| `CollaborationMessageList`   |
| `ComponentConnectionContext` |
| `FormManager`                |
| `MessageManager`             |
| `PresenceManager`            |
| `SystemConnectionContext`    |
