Skip to main content

Module 24: Spring Boot Client

Use the autoconfigured ACP client in a Spring Boot application. Connect to agents with just properties — no manual transport or client construction.

Prerequisites

What You’ll Learn

  • Injecting AcpSyncClient from autoconfiguration
  • Configuring the client transport via application.properties
  • Property-driven transport selection (stdio vs WebSocket)

Dependencies

Same starter as the agent side:

The Client

The autoconfigured AcpSyncClient is injected like any Spring bean:

Configuration

application.properties:
The autoconfiguration detects the stdio.command property and creates a StdioAcpClientTransport that launches the agent as a subprocess.

What the Autoconfiguration Does

  1. Detects transport properties — stdio.command triggers stdio transport; websocket.uri triggers WebSocket
  2. Creates AcpSyncClient and AcpAsyncClient — configured with timeout and client capabilities
  3. Manages shutdown — DisposableBean calls closeGracefully() on context close

Transport Selection

The autoconfiguration picks the transport based on which properties are set:

Build & Run

Client Configuration Properties

View on GitHub