Drop NxtOne into a Spring Boot service with a single dependency.
The NxtOne Java SDK runs inside your JVM and sends behavioral events straight to the NxtOne platform over HTTPS — there is no separate process, container, or daemon to run. On Spring Boot, the starter attaches the SDK for you when the application starts; any other JVM application calls Nxtone.attach() once at the top of main().
Add nxtone-agent-spring-boot-starter to your build, with nxtone.version (Maven) or nxtoneVersion (Gradle) set to the latest release:
Add NxtOne configuration to your application.yml or application.properties:
Or configure entirely through environment variables (recommended for containers):
No annotations, no main() changes, no -javaagent flag, and no JVM arguments (on JDK 17–20). Adding the dependency is the entire integration. Confirm it in the startup output on stderr:
Both lines must appear: the first confirms the SDK attached, the second that capture is open.
Any other JVM application uses the core artifact, ai.nxtone:nxtone-agent, and calls Nxtone.attach() as the first line of main():
If you ship a shaded uber-JAR, set NXTONE_AGENT_JAR to the path of the SDK JAR (for example /path/nxtone-agent.jar). Loading that JAR with -javaagent also works, but it is optional — never required.
| Requirement | Supported | Detail |
|---|---|---|
| Java / JDK | 17+ | The starter and Spring adapter are compiled at maven.compiler.release=17. Java 8 and 11 cannot use this starter. Spring Boot 3.0 requires Java 17+ as a minimum baseline. |
| JDK 21+ | Supported with one flag | Add -XX:+EnableDynamicAgentLoading — see Troubleshooting. |
| Spring Boot | 3.x | Verified against Spring Boot 3.3.7. Boot 2.7.x is not supported because the adapter uses jakarta.servlet exclusively. |
| Framework support | MVC + WebFlux | Spring Web MVC via NxtOneHandlerInterceptor; WebFlux via NxtOneWebFluxAutoConfiguration. Outbound propagation for RestTemplate, WebClient, and OpenFeign. |
| Build tools | Maven, Gradle | Standard Maven and Gradle builds. |
| Filesystem | Writable temp directory | At startup the starter copies its JAR into the JVM's temp directory (/tmp by default); if it can't, it logs nxtone: agent attach failed and the app runs uninstrumented. With a read-only root filesystem, mount an emptyDir or tmpfs at /tmp. |
Supported, user-facing configuration keys. Configure them in application.yml or through environment variables:
| YAML key | Env variable | Default | Description |
|---|---|---|---|
nxtone.api-key | NXTONE_API_KEY | required | API key from the NxtOne dashboard. If absent, the SDK runs as a no-op: it prints a hint to stderr, sends nothing, and never fails your app. |
nxtone.project-id | NXTONE_PROJECT_ID | unknown | Name or ID of your service. Always set it explicitly so each service gets its own project. |
nxtone.exclude | NXTONE_EXCLUDE | empty | Class/package name prefixes to leave uninstrumented (matched with startsWith against fully-qualified class names, not URL paths). |
Outside Spring, the SDK reads the same settings from a properties file, looked up in this order: -Dnxtone.config, $NXTONE_CONFIG_FILE, ~/.nxtone/config.properties, ./nxtone.properties.
Read by the SDK for buffer management and batching:
| Env variable | Default | Effect |
|---|---|---|
NXTONE_BATCH_SIZE | 100 | Events per outbound HTTP batch |
NXTONE_FLUSH_INTERVAL_MS | 500 | Background flush timer interval in milliseconds |
NXTONE_MAX_QUEUE_SIZE | 10,000 | Maximum event queue capacity (bounded in event count) |
NXTONE_MAX_BATCH_BYTES | 512 KiB | Outbound batch byte limit |
NXTONE_MAX_RETRIES | 3 | Max retry attempts with exponential backoff (capped at 30s) before a batch is dropped or spooled to disk |
NXTONE_REQUEST_TIMEOUT_MS | 10,000 | Read timeout for outbound requests (connect timeout capped at 5,000ms) |
NXTONE_SHUTDOWN_TIMEOUT_SECONDS | 5 | Total wall-clock budget for the flush at JVM shutdown |
NXTONE_SPOOL_DIR | unset | If set, batches that exhaust their retries are written here instead of dropped. Off by default. |
The Spring Boot starter registers two entries in META-INF/spring.factories:
nxtone.* config into system properties, then self-attaches the SDK using ByteBuddy's HotSpot attach protocol at LOWEST_PRECEDENCE.ApplicationReadyEvent.Events are batched in memory and sent over HTTPS (443) to api.nxtone.ai; large values go to Amazon S3 through presigned URLs. The SDK opens no listening ports, and it flushes what is still queued when the JVM shuts down.
Jackson, slf4j, JavaParser, ASM) are shaded under ai.nxtone.agent.shaded.* to prevent version collisions.Authorization, Cookie, and Set-Cookie are never read or transmitted.toString(), serializers, or lazy initializers are ever invoked.@Configuration classes, @Repository interfaces, and @Transactional methods are skipped automatically to avoid corrupting Spring Security filter chains or connection pools.Check the SDK's state in the stderr startup output:
| Stderr output line | Meaning |
|---|---|
nxtone: agent attached (pid=...) | Self-attach succeeded. |
nxtone: application ready — capture window open | Capture is live. Both lines are required for full capture. |
nxtone: agent attach failed (...) | Attach failed. The application runs normally, without capture. |
nxtone: could not open capture window at app-ready | Attached, but line/variable capture failed to open. |
nxtone: no api-key configured - running in NO-OP mode | No key found. The SDK runs as a zero-cost no-op. |
-XX:+EnableDynamicAgentLoading. If ByteBuddy transitive versions conflict with Mockito, exclude net.bytebuddy:byte-buddy-agent in your build file.For containers, see Docker and Kubernetes; for anything else, work through Troubleshooting.