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

# DistributionMessenger

> atoti.DistributionMessenger(\
>
>     \*,\
>
>     *discovery\_timeout*: [timedelta](https://docs.python.org/3/library/datetime.html#datetime.timedelta) = `datetime.timedelta(seconds=60)`,\
>
>     *hello\_message\_timeout*: [timedelta](https://docs.python.org/3/library/datetime.html#datetime.timedelta) = `datetime.timedelta(seconds=2)`,\
>
>     *hello\_message\_trials*: [int](https://docs.python.org/3/builtins/functions.html#int) = `10`,\
>
>     *message\_timeout*: [timedelta](https://docs.python.org/3/library/datetime.html#datetime.timedelta) = `datetime.timedelta(seconds=30)`,\
>
>     *transaction\_timeout*: [timedelta](https://docs.python.org/3/library/datetime.html#datetime.timedelta) = `datetime.timedelta(seconds=30)`,\
>
> )

The messengers through which the cubes of a cluster talk to each other.

Each attribute applies to the cubes that read it: the data cubes joining the cluster, its query cubes, or both.

### Attributes

#### *discovery\_timeout*

How long a data cube waits for a query cube to acknowledge its discovery.

The discovery is the message holding the members of the data cube, sent when it joins the cluster, so the larger the data cube, the longer it takes to send.
Once this timeout is reached, the data cube logs `may not have been transmitted` and greets the query cube again, even if the discovery is still on its way.
Set it above the time the largest data cube takes to send its discovery, which the data cube logs in `successfully transmitted to [...] in [...]`.

#### *hello\_message\_timeout*

How long a data cube waits for a query cube to answer each of its hello messages.

A data cube sends a hello message to greet a query cube, before sending its discovery.

#### *hello\_message\_trials*

How many hello messages a data cube sends to a query cube before it gives up greeting it.

Each of them waits for [`hello_message_timeout`](#atoti.DistributionMessenger.hello_message_timeout).

#### *message\_timeout*

How long a data or query cube waits for the reply to a message that has no timeout of its own.

Discoveries, hello messages and commits have their own: [`discovery_timeout`](#atoti.DistributionMessenger.discovery_timeout), [`hello_message_timeout`](#atoti.DistributionMessenger.hello_message_timeout) and [`transaction_timeout`](#atoti.DistributionMessenger.transaction_timeout).

#### *transaction\_timeout*

How long a data cube waits for the query cubes to acknowledge one of its commits.

Once this timeout is reached, the data cube logs `TimeoutException: The message TransactionCommittedMessage [...] may not have been received`.
