Skip to content
Mario edited this page Sep 23, 2026 · 1 revision

Frequently asked questions (FAQ)

Common questions about using and operating Vyra.


Architecture & setup

Why does Vyra require me to explicitly choose a serializer?

vyra-core is intentionally designed with zero third-party dependencies. It bundles neither Jackson nor Gson, so you don't inherit library version conflicts in your project. Choosing your serializer explicitly makes the wire format a deliberate architectural decision. See Serialization.

Can I run Vyra without Redis or Docker?

Yes. The vyra-inmemory module provides an in-memory transport that runs completely inside the JVM without Docker or network dependencies. It works well for unit tests, mocking, and local development. See Transports.

Does Vyra support Spring Boot or Micronaut?

Yes. Because Vyra relies on plain Java records and standard CompletionStage APIs with zero DI or bytecode reflection, you can declare Vyra as a Spring @Bean or inject it into your service classes.


Messaging & semantics

How do I scale worker nodes for a service?

Launch multiple instances of your service that register a handler for the same target (e.g. vyra.handle("billing", ...)). The transport distributes incoming requests across all available workers in a round-robin worker queue.

What happens if a request times out?

The pending request is removed from memory, and the caller's CompletionStage immediately completes exceptionally with a VyraTimeoutException. If the remote worker finishes later and replies, Vyra safely discards the late response without leaking memory. See Timeouts & errors.

Are events guaranteed to be delivered if a service is down?

No. Events are delivered at-most-once: if a subscriber is offline when an event is published, the event will not be delivered when it restarts. For guaranteed delivery or work processing, use Request / response.

How do I query multiple nodes simultaneously (e.g. locate an entity across a cluster)?

Use vyra.broadcastRequest("target", req, Response.class, timeout). It broadcasts the request to all nodes handling the target (bcast:<target>). Handlers that cannot answer or do not own the entity return null (or complete with null) and stay silent. The first node that returns a non-null response completes the request stage directly to the caller (res:<clientNodeId>), while subsequent responses are safely discarded. See Request / response.


Serialization & types

Can I return a List<T> directly as a response type?

Not directly, because Java erases generic type parameters at runtime (List<Player>.class is not valid Java syntax). Instead, wrap the list inside a concrete record:

public record PlayerListResponse(List<Player> players) {}

See Best practices.

Can I mix different serializers (e.g. Jackson on Node A, Gson on Node B)?

No. All nodes sharing the same transport must adhere to the uniform network constraint and use the same serializer. Mixing formats (e.g. Smile and JSON) will cause envelopes to be dropped with a warning. See Serialization.

Why did large numbers lose precision when using Gson?

Google Gson treats untyped JSON numbers as Double by default, which loses precision for 64-bit integers exceeding $2^{53}$. If you deal with large integer IDs (like Snowflakes), represent them as String or BigDecimal, or use JacksonSerializer instead.


Concurrency & operations

Will a slow handler block the network I/O loop?

No. Vyra isolates network I/O threads (async event loops and dedicated blocking worker-queue threads) from user logic. User handlers and deserialization are immediately submitted to a separate handler executor. Even if a handler blocks on a slow SQL query, the network loops remain fully responsive. See Concurrency.

Who is responsible for shutting down the RedisClient?

You are. Following the lifecycle rule (supplied = yours, created = ours), calling vyra.close() closes only the connections opened by that specific Vyra instance. It never shuts down the underlying RedisClient, allowing you to share the client safely across multiple services or DAOs. See Configuration.

What happens if a node receives garbage or non-Vyra data?

Vyra will attempt to deserialize the envelope. If it fails, Vyra logs a warning describing the unparseable message and safely drops it. The node will never crash.


Next steps

Vyra documentation

Getting started and messaging patterns

Transports and formats

Inside the framework

Reference

Clone this wiki locally