JVM framework adapters · Java 17 · version 3.3.2

CoAkka Runtime with Spring Boot and Quarkus

The framework continues to own HTTP, DI/CDI, validation, security, and lifecycle. CoAkka Runtime receives only app-owned work through a target, routes, bounded admission, and a reply or deadletter.

Choose the right boundary

CoAkka target

App-owned work

Use it when the capability remains owned by the app or team and may start local, then move to a peer without changing the caller's target.

HTTP client

A real service API

Keep HTTP when the endpoint has independent ownership, URL/discovery, status, headers, auth propagation, and governance.

Framework edge

Not replaced

Spring/Quarkus still owns public ingress, transactions, validation, framework security, and the public response.

Two adapters, one Core generation

Gradle · choose one
// Spring Boot
implementation("io.github.phuong-tran.coakka:spring-boot-starter:3.3.2")

// Or Quarkus
implementation("io.github.phuong-tran.coakka:quarkus-extension:3.3.2")
Repository
Maven Central.
Java
17 for the framework application.
Runtime dependency
Each adapter depends exactly on runtime:3.3.2; neither creates a second Core.
Framework version
The app owns its Spring Boot or Quarkus platform version; the adapter does not import a BOM for the app.

Spring Boot: the HTTP edge calls a runtime target

Kotlin · handler
@Component
class CustomerCapabilityHandlers(
    private val store: InMemoryCustomerStore,
) {
    @CoAkkaHandler("samples.customer.create")
    fun create(command: CustomerDraft): MutationResponse {
        return store.create(command)
    }
}
Kotlin · controller call site
@PostMapping("/api/customers")
@ResponseStatus(HttpStatus.CREATED)
fun create(request: CustomerDraft): MutationResponse {
    return runtimeClient.askBlocking(
        "samples.customer.create",
        request,
        MutationResponse::class.java,
        "create_customer",
        5_000,
    )
}

The controller remains the public HTTP boundary. The target names a capability; its handler can run locally today and move to a peer later without turning the controller into private-URL management code.

Quarkus: a CDI-backed handler

Kotlin · handler shape
@ApplicationScoped
@CoAkkaHandler("samples.customer.store")
class CustomerCapabilityHandler(
    private val store: InMemoryCustomerStore,
) : CoAkkaLocalHandler {
    override fun handle(
        request: ConnectorEnvelope,
        objectMapper: ObjectMapper,
    ): ConnectorEnvelope {
        val command = objectMapper.readValue(
            request.payload,
            CustomerDraft::class.java,
        )
        return CoAkkaReplies.json(
            request,
            "samples.customer.store",
            store.create(command),
            CustomerPayloads.MUTATION_RESPONSE,
            objectMapper,
        )
    }
}
Kotlin · resource call site
@POST
@Path("/api/customers")
fun create(request: CustomerDraft): MutationResponse {
    return coakka.askBlocking(
        "samples.customer.store",
        request,
        CustomerPayloads.CREATE,
        MutationResponse::class.java,
        "create_customer",
        5_000,
    )
}

CDI still owns the bean graph and app lifecycle; CoAkka Runtime owns delivery to the target and its structured terminal outcome.

Run the exact Spring Boot and Quarkus projects

Create this two-module Gradle project. Both apps use Java 17 and Kotlin named arguments. Each framework owns HTTP on /verify; the controller/resource calls a same-process CoAkka Runtime target and returns the handler's JSON reply.

Shared Gradle files
settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
}

rootProject.name = "coakka-portal-framework-checks"
include("spring-app", "quarkus-app")
build.gradle.kts
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "2.3.10" apply false
    kotlin("plugin.spring") version "2.3.10" apply false
    kotlin("plugin.allopen") version "2.3.10" apply false
    id("org.springframework.boot") version "3.5.16" apply false
    id("io.quarkus") version "3.35.2" apply false
}

allprojects {
    repositories { mavenCentral() }
    val outputRoot = providers.environmentVariable("COAKKA_PORTAL_BUILD_ROOT").orNull
    if (outputRoot != null) {
        layout.buildDirectory.set(file(outputRoot).resolve(path.removePrefix(":").ifEmpty { "root" }))
    }
}

subprojects {
    tasks.withType<KotlinCompile>().configureEach {
        compilerOptions {
            jvmTarget.set(JvmTarget.JVM_17)
            allWarningsAsErrors.set(true)
        }
    }
}
gradle.properties
kotlin.compiler.execution.strategy=in-process
Spring Boot module
spring-app/build.gradle.kts
plugins {
    kotlin("jvm")
    kotlin("plugin.spring")
    id("org.springframework.boot")
}

dependencies {
    implementation(platform("org.springframework.boot:spring-boot-dependencies:3.5.16"))
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
    implementation("io.github.phuong-tran.coakka:spring-boot-starter:3.3.2")
}

kotlin { jvmToolchain(17) }
spring-app/src/main/kotlin/portal/spring/PortalSpringApp.kt
package portal.spring

import coakka.spring.CoAkkaHandler
import coakka.spring.CoAkkaRuntimeClient
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.stereotype.Component
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

private const val target = "portal.spring.echo"

data class EchoRequest(val message: String)

data class EchoReply(val message: String, val handledBy: String)

@Component
class EchoHandler {
    @CoAkkaHandler(target)
    fun echo(request: EchoRequest): EchoReply {
        return EchoReply(message = request.message, handledBy = "spring-handler")
    }
}

@RestController
class VerifyController(private val runtimeClient: CoAkkaRuntimeClient) {
    @GetMapping("/verify")
    fun verify(): EchoReply {
        return runtimeClient.askBlocking(
            target,
            EchoRequest(message = "hello-coakka-runtime"),
            EchoReply::class.java,
            "portal_spring_check",
            2_000,
        )
    }
}

@SpringBootApplication
class PortalSpringApp

fun main(args: Array<String>) {
    runApplication<PortalSpringApp>(*args)
}
spring-app/src/main/resources/application.properties
server.port=18082
coakka.runtime.system-name=portal-spring
coakka.runtime.node-id=portal-spring-1
coakka.runtime.source-target=portal.spring.http
Build and start
gradle :spring-app:bootJar
java -jar spring-app/build/libs/spring-app.jar
Another terminal
curl http://127.0.0.1:18082/verify
Quarkus module
quarkus-app/build.gradle.kts
plugins {
    kotlin("jvm")
    kotlin("plugin.allopen")
    id("io.quarkus")
}

dependencies {
    implementation(platform("io.quarkus.platform:quarkus-bom:3.35.2"))
    implementation("io.quarkus:quarkus-kotlin")
    implementation("io.quarkus:quarkus-arc")
    implementation("io.quarkus:quarkus-rest-jackson")
    implementation("io.github.phuong-tran.coakka:quarkus-extension:3.3.2")
}

allOpen {
    annotation("jakarta.enterprise.context.ApplicationScoped")
    annotation("jakarta.ws.rs.Path")
}

kotlin { jvmToolchain(17) }
quarkus-app/src/main/kotlin/portal/quarkus/PortalQuarkusApp.kt
package portal.quarkus

import coakka.quarkus.CoAkkaHandler
import coakka.quarkus.CoAkkaJsonHandler
import coakka.quarkus.CoAkkaRuntimeClient
import coakka.v2.connector.protocol.ConnectorPayloadFormat
import coakka.v2.connector.protocol.ConnectorPayloadIdentity
import jakarta.enterprise.context.ApplicationScoped
import jakarta.ws.rs.GET
import jakarta.ws.rs.Path
import jakarta.ws.rs.Produces
import jakarta.ws.rs.core.MediaType

private const val target = "portal.quarkus.echo"

data class EchoRequest(val message: String = "")

data class EchoReply(val message: String = "", val handledBy: String = "")

private val requestIdentity = ConnectorPayloadIdentity(
    messageType = "portal.quarkus.echo.request.v1",
    payloadSchemaVersion = 1,
    payloadFormat = ConnectorPayloadFormat.JSON,
)
private val replyIdentity = ConnectorPayloadIdentity(
    messageType = "portal.quarkus.echo.reply.v1",
    payloadSchemaVersion = 1,
    payloadFormat = ConnectorPayloadFormat.JSON,
)

@ApplicationScoped
@CoAkkaHandler(target)
class EchoHandler : CoAkkaJsonHandler<EchoRequest, EchoReply> {
    override fun requestType(): Class<EchoRequest> = EchoRequest::class.java

    override fun responseIdentity(response: EchoReply): ConnectorPayloadIdentity {
        return replyIdentity
    }

    override fun handlePayload(payload: EchoRequest): EchoReply {
        return EchoReply(message = payload.message, handledBy = "quarkus-handler")
    }
}

@Path("/verify")
@Produces(MediaType.APPLICATION_JSON)
class VerifyResource(private val runtimeClient: CoAkkaRuntimeClient) {
    @GET
    fun verify(): EchoReply {
        return runtimeClient.askBlocking(
            target,
            EchoRequest(message = "hello-coakka-runtime"),
            requestIdentity,
            EchoReply::class.java,
            "portal_quarkus_check",
            2_000,
        )
    }
}
quarkus-app/src/main/resources/application.properties
quarkus.http.port=18083
coakka.runtime.system-name=portal-quarkus
coakka.runtime.node-id=portal-quarkus-1
coakka.runtime.source-target=portal.quarkus.http
Build and start
gradle :quarkus-app:quarkusBuild
java -jar quarkus-app/build/quarkus-app/quarkus-run.jar
Another terminal
curl http://127.0.0.1:18083/verify

Expected replies

{"message":"hello-coakka-runtime","handledBy":"spring-handler"}
{"message":"hello-coakka-runtime","handledBy":"quarkus-handler"}

Quarkus DTO rule. The small DTOs provide defaults so the application ObjectMapper has an explicit no-argument construction path. A serialization failure inside the handler is not a route miss; preserve the handler cause instead of increasing the request timeout.

Configuration and lifecycle

application.properties · optional Monitor
coakka.runtime.monitor-enabled=true

Read outcomes · Read peers/failover · Read effective state