CoAkka Runtime · JVM 3.3.2

Java + Kotlin/JVM cheat sheet

One connector, two host-language surfaces. Kotlin favors named arguments; Java uses getJava(), CompletableFuture and blocking helpers.

Version, package and build

Maven dependency
<dependency>
  <groupId>io.github.phuong-tran.coakka</groupId>
  <artifactId>runtime</artifactId>
  <version>3.3.2</version>
</dependency>
Gradle dependency
implementation("io.github.phuong-tran.coakka:runtime:3.3.2")
Connector
runtime:3.3.2. The first two numbers identify Core generation 3.3; the last is the connector revision.
Lesson environment
JDK 17 and either Maven 3.9+ or Gradle 9.2.1.
Consumer floor
Java 8 package compatibility does not require a Java 8 lesson build.
Native targets in the JAR
macOS ARM64, Linux ARM64/x64 and Windows ARM64/x64. Support claims still require evidence for the connector + OS + CPU tuple.
API names
CoAkka.local is Level 1; the exact JVM 3.3.2 Level 2 owner is ConnectorOrchestrator.

Embedded request/reply

Kotlin
val runtime = CoAkka.local(
    systemName = "orders",
    nodeId = "orders-1",
)
runtime.handler(target = "orders.quote") { payload -> quote(payload) }
val reply = runtime.ask(
    target = "orders.quote",
    payloadUtf8 = "2",
    timeoutMs = 2_000,
)
runtime.shutdown()

Java uses ConnectorOrchestrator.start, registerTextHandler, runtime.getJava().askTextBlocking, and waits for the shutdown() future. Copy a complete Java or Kotlin sample.

Outcomes, Deadletter and OneWay

Reply
askText or ask completes with the correlated response.
Deadletter
DeadletterException.deadletter carries reason, original envelope, generation, resolved endpoint, attempt count and causal failure facts.
Timeout/cancel
A separate failure boundary. Do not retry side effects without an idempotency contract.
OneWay
sendOneWay has no business acknowledgement; admission observability does not turn it into Ask.
Terminal stream
submitRequest plus terminalEvents separates submission from waiting over the same runtime outcome contract.

Envelope, Ask, OneWay and Deadletter reference.

Direct peer

Service
network = RuntimeNetworkConfig.networkNode(
    bindHost = "0.0.0.0",
    bindPort = 19_321,
    advertiseHost = "pricing.internal",
    advertisePort = 19_321,
)
Caller route
network = RuntimeNetworkConfig.outboundOnly(),
routes = listOf(
    RuntimeRouteSpec(
        target = "orders.quote",
        endpoints = listOf(
            RuntimeEndpointSpec(
                host = "pricing.internal",
                port = 19_321,
                weight = 1,
            ),
        ),
        strategy = RuntimeRouteStrategy.SINGLE_OWNER,
    ),
)

CoAkka Runtime does not require Kubernetes; the topology owner supplies generation-stamped route snapshots. Open the two-process example.

File Lane

  1. Compute FileLane.sha256(path = source).
  2. The receiver calls openOwned and prepareReceiveGrant.
  3. Send the grant over an authenticated control plane; sender calls submitSend.
  4. Wait for both SEND and RECEIVE terminal receipts; check completed and result.
  5. Record the outcome, forget both records and close both owners.

Copy the runnable example · Failures and bounds

Stream Lane

  1. The publisher calls openOwned and issues a StreamPublishGrant.
  2. StreamSource.next writes into the borrowed destination and returns Frame, WouldBlock or End.
  3. The subscriber uses the grant, a receive window and StreamConsumer.
  4. Copy data before the callback ends when it must be retained.
  5. Wait for PUBLISH/SUBSCRIBE terminal receipts, record, forget and close.
  6. Use pressure snapshots as input to bounded application policy.

Copy the runnable example · Pressure and flow control

Monitor and effective state

RuntimeMonitorOptions(enabled = true)
Startup intent; verify with monitor.isEnabled().
monitor.snapshot()
Copied latest health and stats.
awaitNext(timeoutMs = ...)
Bounded doorbell wait; null means no signal in the window.
startupConfig()
Core-accepted default groups and construction facts.
runtimeConfig() / networkConfig()
State, generation, routes, queues, network and provenance.
runtimeCapabilities()
Compiled, entitled and effective facts before advanced transport.

Run the configuration lab · Operations & Evidence

Integration checklist

Open the Java + Kotlin/JVM configuration reference.