Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/run-spring-boot-rest-tck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Run Spring Boot REST TCK

on:
push:
branches:
- main
paths-ignore:
- '**/docs/**'
pull_request:
branches:
- main
paths-ignore:
- '**/docs/**'
workflow_dispatch:

env:
# Tag/branch of the TCK
TCK_VERSION: 1.0.0.alpha2
# Tells uv to not need a venv, and instead use system
UV_SYSTEM_PYTHON: 1
SUT_URL: http://localhost:9999

# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
spring-boot-rest-tck:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout a2a-java
uses: actions/checkout@v6

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build Spring Boot server modules
run: mvn -B -pl integrations/spring-boot/server -am test

- name: Checkout a2a-tck
uses: actions/checkout@v6
with:
repository: a2aproject/a2a-tck
path: a2a-tck
ref: ${{ env.TCK_VERSION }}

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: 'a2a-tck/pyproject.toml'

- name: Install uv and Python dependencies
run: |
pip install uv
uv pip install -e .
working-directory: a2a-tck

- name: Run Spring Boot REST TCK
id: run-tck
run: bash ./scripts/run-spring-boot-rest-tck.sh
env:
TCK_DIR: a2a-tck
SUT_URL: ${{ env.SUT_URL }}

- name: TCK Summary
if: always()
run: |
echo '### Spring Boot REST TCK Results' >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
if [ -f tck-output.log ]; then
tail -n 120 tck-output.log >> "$GITHUB_STEP_SUMMARY"
else
echo 'TCK log was not generated.' >> "$GITHUB_STEP_SUMMARY"
fi
echo '```' >> "$GITHUB_STEP_SUMMARY"

- name: Upload TCK Reports
if: always()
uses: actions/upload-artifact@v7
with:
name: spring-boot-rest-tck-reports
path: |
a2a-tck/reports/
spring-boot-rest-sut.log
spring-boot-rest-sut.pid
tck-output.log
retention-days: 14
if-no-files-found: warn
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ You can find examples of how to use the A2A Java SDK in the [a2a-samples reposit

More examples will be added soon.

The repository also contains runnable examples in the `examples/` tree, including:

- `examples/helloworld` for Quarkus-based hello world client and server samples
- `examples/spring-boot` for Spring Boot server examples

## A2A Server

The A2A Java SDK provides a Java server implementation of the [Agent2Agent (A2A) Protocol](https://a2a-protocol.org/). To run your agentic Java application as an A2A server, simply follow the steps below.
Expand Down Expand Up @@ -909,6 +914,7 @@ The following list contains community contributed integrations with various Java

To contribute an integration, please see [CONTRIBUTING_INTEGRATIONS.md](CONTRIBUTING_INTEGRATIONS.md).

* Spring Boot server integration modules live under [`integrations/spring-boot/server`](integrations/spring-boot/server/README.md).
* This project contains integration with Quarkus and has the reference implementations for the JSON-RPC, gRPC, and HTTP+JSON (REST) transports.
* https://github.com/wildfly-extras/a2a-jakarta - This integration is based on Jakarta EE, and should work in all runtimes supporting the [Jakarta EE Web Profile](https://jakarta.ee/specifications/webprofile/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ExtrasBomVerifier extends DynamicBomVerifier {
private static final Set<String> EXTRAS_EXCLUSIONS = Set.of(
"boms/", // BOM test modules themselves
"examples/", // Example applications
"integrations/spring-boot/", // Spring Boot integration tree is verified separately
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"tests/", // Integration tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ReferenceBomVerifier extends DynamicBomVerifier {
private static final Set<String> REFERENCE_EXCLUSIONS = Set.of(
"boms/", // BOM test modules themselves
"examples/", // Example applications
"integrations/spring-boot/", // Spring Boot integration tree is verified separately
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"tests/", // Integration tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class SdkBomVerifier extends DynamicBomVerifier {
private static final Set<String> SDK_EXCLUSIONS = Set.of(
"boms/", // BOM test modules themselves
"examples/", // Example applications
"integrations/spring-boot/", // Spring Boot integration tree is tested separately
"itk/", // Integration Test Kit agent
"tck/", // TCK test suite
"compat-0.3/tck/", // Compat 0.3 TCK (not yet enabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Base class for dynamically discovering and verifying all classes in a BOM can be loaded.
* Subclass this and pass BOM-specific exclusions and forbidden paths to the constructor.
*
* - Excluded paths: Not tested at all (e.g., boms/, examples/, tck/, tests/)
* - Excluded paths: Not tested at all (e.g., boms/, examples/, integrations/spring-boot/, tck/, tests/)
* - Forbidden paths: Must NOT be loadable (proves BOM doesn't include wrong dependencies)
* - Required paths: Must be loadable (everything else)
*/
Expand Down
74 changes: 74 additions & 0 deletions examples/spring-boot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# A2A Java SDK - Spring Boot Examples

This directory contains runnable Spring Boot examples for the A2A Java SDK.

## Layout

- `rest/`
- REST transport examples.
- Currently includes runnable server and client examples.
- `server/`
- Runnable Spring Boot REST server example.
- `client/`
- Runnable Spring Boot REST client example.
- `jsonrpc/`
- Reserved for future JSON-RPC examples.
- `server/`
- Reserved for a future Spring Boot JSON-RPC server example.
- `client/`
- Reserved for a future Spring Boot JSON-RPC client example.
- `grpc/`
- Reserved for future gRPC examples.
- `server/`
- Reserved for a future Spring Boot gRPC server example.
- `client/`
- Reserved for a future Spring Boot gRPC client example.

## Current Example

- `rest/server`
- Demonstrates a runnable A2A server built with the Spring Boot REST starter.
- Exposes the standard A2A REST endpoints.
- `rest/client`
- Demonstrates a runnable Spring Boot client that calls the server and logs the response.

## Run

The REST example can be started in two terminals:

```bash
mvn -pl examples/spring-boot/rest/server -am spring-boot:run
```

```bash
mvn -pl examples/spring-boot/rest/client -am spring-boot:run
```

The server listens on `http://localhost:18080` and the client connects to that URL by default.

## Endpoint Preview

Once running, the example exposes:

- `/.well-known/agent-card.json`
- `POST /message:send`
- `POST /message:stream`
- `GET /tasks/{taskId}`
- `GET /tasks`
- `POST /tasks/{taskId}:cancel`
- `POST /tasks/{taskId}:subscribe`
- `POST /tasks/{taskId}/pushNotificationConfigs`
- `GET /tasks/{taskId}/pushNotificationConfigs/{configId}`
- `GET /tasks/{taskId}/pushNotificationConfigs`
- `DELETE /tasks/{taskId}/pushNotificationConfigs/{configId}`
- `GET /extendedAgentCard`

## Next Transport Examples

The example tree is transport-first so `jsonrpc` and `grpc` can be added later as sibling transport roots.

## Build

```bash
mvn -pl examples/spring-boot -am test
```
11 changes: 11 additions & 0 deletions examples/spring-boot/grpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A2A Java SDK - Spring Boot gRPC Examples

Reserved for future Spring Boot gRPC examples.

## Build

No buildable module exists yet. When it is added, use:

```bash
mvn -pl examples/spring-boot/grpc -am test
```
11 changes: 11 additions & 0 deletions examples/spring-boot/grpc/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A2A Java SDK - Spring Boot gRPC Client Example

Reserved for a future Spring Boot gRPC client example.

## Build

No buildable module exists yet. When it is added, use:

```bash
mvn -pl examples/spring-boot/grpc/client -am test
```
11 changes: 11 additions & 0 deletions examples/spring-boot/grpc/server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A2A Java SDK - Spring Boot gRPC Server Example

Reserved for a future Spring Boot gRPC server example.

## Build

No buildable module exists yet. When it is added, use:

```bash
mvn -pl examples/spring-boot/grpc/server -am test
```
11 changes: 11 additions & 0 deletions examples/spring-boot/jsonrpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A2A Java SDK - Spring Boot JSON-RPC Examples

Reserved for future Spring Boot JSON-RPC examples.

## Build

No buildable module exists yet. When it is added, use:

```bash
mvn -pl examples/spring-boot/jsonrpc -am test
```
11 changes: 11 additions & 0 deletions examples/spring-boot/jsonrpc/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A2A Java SDK - Spring Boot JSON-RPC Client Example

Reserved for a future Spring Boot JSON-RPC client example.

## Build

No buildable module exists yet. When it is added, use:

```bash
mvn -pl examples/spring-boot/jsonrpc/client -am test
```
11 changes: 11 additions & 0 deletions examples/spring-boot/jsonrpc/server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A2A Java SDK - Spring Boot JSON-RPC Server Example

Reserved for a future Spring Boot JSON-RPC server example.

## Build

No buildable module exists yet. When it is added, use:

```bash
mvn -pl examples/spring-boot/jsonrpc/server -am test
```
47 changes: 47 additions & 0 deletions examples/spring-boot/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.a2aproject.sdk</groupId>
<artifactId>a2a-java-sdk-parent</artifactId>
<version>1.1.0.Final</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>a2a-java-sdk-examples-spring-boot</artifactId>
<packaging>pom</packaging>

<name>Java SDK A2A Examples - Spring Boot</name>
<description>Spring Boot examples for the Java SDK for the Agent2Agent Protocol (A2A)</description>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.5.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<modules>
<module>rest</module>
</modules>
</project>
Loading