O
O
Orbit
Search…
configuration
Orbit Client offers a broad set of configuration options to be supplied in its constructor. Some settings are required to discover addressables and connect to an Orbit Server cluster, while others can fine-tune how the client operates.
The OrbitClientConfig class contains the configuration values the OrbitClient needs to operate and is supplied in the constructor:
1
import orbit.client.OrbitClient
2
import orbit.client.OrbitClientConfig
3
4
fun main() {
5
runBlocking {
6
val orbitClient = OrbitClient(
7
OrbitClientConfig(
8
namespace = "carnival",
9
grpcEndpoint = "dns:///localhost:50056/",
10
...
11
)
12
)
13
orbitClient.start().join()
14
}
15
}
Copied!

Required fields

namespace: String

The namespace to use when connecting to the Orbit cluster. This namespace will identify all the client nodes as part of a system, isolated from any other namespaces. Care must be taken if multiple independent deployments utilize the same Orbit services so that the namespaces they use don't intersect. This will result in confusion as addressables are activated in unexpected places.

grpcEndpoint: String

The gRPC endpoint where the Orbit server cluster is located. Should be of the form dns:///<host>:<port>/.

Interesting optional fields

packages: List<String>

Packages to scan for addressables. If left blank, all packages will be scanned. Example:
1
packages = listOf("orbit.carnival.actors")
Copied!

addressableTTL: Duration

Time To Live (TTL) for addressables before client deactivation.

addressableConstructor: ExternallyConfigured<AddressableConstructor>

The system to use to construct addressables. The default value calls the addressable's default empty constructor. More information on bringing your own DI can be found in the Dependency Injection section.

platformExceptions: Boolean

Rethrow platform specific exceptions. Note: Should only be used when all clients are using the same SDK.

containerOverrides: ComponentContainerRoot.() -> Unit

Hook to update internal container registrations after initialization. Example:
1
containerOverrides = {
2
instance(kodein)
3
instance(sqlDatabaseAdapter)
4
definition<HealthService>()
5
}
Copied!

bufferCount: Int

The number of messages (inbound) that may be queued before new messages are rejected. This applies back pressure protection to prevent being overwhelmed with incoming messages.
Last modified 1yr ago