Class LocalClient

java.lang.Object
io.fluxzero.sdk.configuration.client.AbstractClient
io.fluxzero.sdk.configuration.client.LocalClient
All Implemented Interfaces:
Namespaced<Client>, Client

public class LocalClient extends AbstractClient
An in-memory Client implementation used for local development, testing, or isolated environments where no connection to the Fluxzero Runtime is required.

This client simulates all major subsystems — including event storage, scheduling, key-value access, and document search — using in-memory data structures with optional message expiration. It is ideal for use cases such as:

  • Unit testing message handlers
  • Running local development instances without Fluxzero Runtime dependencies
  • Offline simulations and demos

Configuration

The default expiration time for messages and scheduled tasks is 2 minutes, but a custom duration can be specified:
LocalClient client = LocalClient.newInstance(Duration.ofMinutes(5));

Features

  • Simulates gateway clients for all MessageTypes
  • Provides in-memory implementations of event store, scheduling, key-value, and search clients
  • Uses the FLUXZERO_TASK_ID environment property or the JVM process name as the client ID
  • Reads FLUXZERO_APPLICATION_NAME and FLUXZERO_APPLICATION_ID from environment or system properties

Usage

Typical usage involves passing this client into the FluxzeroBuilder:
Fluxzero fluxzero = DefaultFluxzero.builder().build(LocalClient.newInstance());