JNI / Java Integration

Vespera can embed your Axum router directly inside a Java/Spring application — no TCP socket, no JSON envelope overhead, raw bytes from end to end.

The vespera-bridge library (kr.devfive:vespera-bridge) provides a Spring Boot autoconfiguration that wires up a catch-all VesperaProxyController. Every HTTP request Spring receives is forwarded to Rust through a length-prefixed binary wire format, and the response comes back the same way.

Why In-Process?

A traditional microservice setup adds a full HTTP round-trip between Java and Rust. In-process JNI dispatch eliminates that entirely:

Quick Navigation

Two-Line Integration

Rust side:

pub fn create_app() -> vespera::axum::Router {
    vespera!(title = "My API")
}
 
vespera::jni_app!(create_app);

Java side:

@SpringBootApplication
@ComponentScan(basePackages = {"com.example.app", "com.devfive.vespera.bridge"})
public class MyApp {
    public static void main(String[] args) {
        VesperaBridge.init("my_rust_lib");
        SpringApplication.run(MyApp.class, args);
    }
}

That's it. VesperaProxyController is autoconfigured and forwards every HTTP request to Rust. Zero controller code, zero application.yml config, zero extra imports beyond the Spring Boot starter.

Contents
Edit this page
문의 및 의견 제출
contact@devfive.kr
Copyright © DEVFIVE. All Rights Reserved.
DEVFIVE