Skip to content

Commit 2133456

Browse files
committed
feat(integrations/spring-boot): add initial Spring Boot server integration
1 parent 8a101ca commit 2133456

85 files changed

Lines changed: 5638 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Run Spring Boot REST TCK
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**/docs/**'
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- '**/docs/**'
14+
workflow_dispatch:
15+
16+
env:
17+
# Tag/branch of the TCK
18+
TCK_VERSION: 1.0.0.alpha2
19+
# Tells uv to not need a venv, and instead use system
20+
UV_SYSTEM_PYTHON: 1
21+
SUT_URL: http://localhost:9999
22+
23+
# Only run the latest job
24+
concurrency:
25+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
26+
cancel-in-progress: true
27+
28+
jobs:
29+
spring-boot-rest-tck:
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 30
32+
steps:
33+
- name: Checkout a2a-java
34+
uses: actions/checkout@v6
35+
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v5
38+
with:
39+
java-version: '17'
40+
distribution: 'temurin'
41+
cache: maven
42+
43+
- name: Build Spring Boot server modules
44+
run: mvn -B -pl integrations/spring-boot/server -am test
45+
46+
- name: Checkout a2a-tck
47+
uses: actions/checkout@v6
48+
with:
49+
repository: a2aproject/a2a-tck
50+
path: a2a-tck
51+
ref: ${{ env.TCK_VERSION }}
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v6
55+
with:
56+
python-version-file: 'a2a-tck/pyproject.toml'
57+
58+
- name: Install uv and Python dependencies
59+
run: |
60+
pip install uv
61+
uv pip install -e .
62+
working-directory: a2a-tck
63+
64+
- name: Run Spring Boot REST TCK
65+
id: run-tck
66+
run: bash ./scripts/run-spring-boot-rest-tck.sh
67+
env:
68+
TCK_DIR: a2a-tck
69+
SUT_URL: ${{ env.SUT_URL }}
70+
71+
- name: TCK Summary
72+
if: always()
73+
run: |
74+
echo '### Spring Boot REST TCK Results' >> "$GITHUB_STEP_SUMMARY"
75+
echo '```' >> "$GITHUB_STEP_SUMMARY"
76+
if [ -f tck-output.log ]; then
77+
tail -n 120 tck-output.log >> "$GITHUB_STEP_SUMMARY"
78+
else
79+
echo 'TCK log was not generated.' >> "$GITHUB_STEP_SUMMARY"
80+
fi
81+
echo '```' >> "$GITHUB_STEP_SUMMARY"
82+
83+
- name: Upload TCK Reports
84+
if: always()
85+
uses: actions/upload-artifact@v7
86+
with:
87+
name: spring-boot-rest-tck-reports
88+
path: |
89+
a2a-tck/reports/
90+
spring-boot-rest-sut.log
91+
spring-boot-rest-sut.pid
92+
tck-output.log
93+
retention-days: 14
94+
if-no-files-found: warn

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ You can find examples of how to use the A2A Java SDK in the [a2a-samples reposit
3232

3333
More examples will be added soon.
3434

35+
The repository also contains runnable examples in the `examples/` tree, including:
36+
37+
- `examples/helloworld` for Quarkus-based hello world client and server samples
38+
- `examples/spring-boot` for Spring Boot server examples
39+
3540
## A2A Server
3641

3742
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.
@@ -909,6 +914,7 @@ The following list contains community contributed integrations with various Java
909914

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

917+
* Spring Boot server integration modules live under [`integrations/spring-boot/server`](integrations/spring-boot/server/README.md).
912918
* This project contains integration with Quarkus and has the reference implementations for the JSON-RPC, gRPC, and HTTP+JSON (REST) transports.
913919
* 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/).
914920

boms/extras/src/it/extras-usage-test/src/main/java/org/a2aproject/sdk/test/ExtrasBomVerifier.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class ExtrasBomVerifier extends DynamicBomVerifier {
1414
private static final Set<String> EXTRAS_EXCLUSIONS = Set.of(
1515
"boms/", // BOM test modules themselves
1616
"examples/", // Example applications
17+
"integrations/spring-boot/", // Spring Boot integration tree is verified separately
1718
"itk/", // Integration Test Kit agent
1819
"tck/", // TCK test suite
1920
"tests/", // Integration tests

boms/reference/src/it/reference-usage-test/src/main/java/org/a2aproject/sdk/test/ReferenceBomVerifier.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class ReferenceBomVerifier extends DynamicBomVerifier {
1414
private static final Set<String> REFERENCE_EXCLUSIONS = Set.of(
1515
"boms/", // BOM test modules themselves
1616
"examples/", // Example applications
17+
"integrations/spring-boot/", // Spring Boot integration tree is verified separately
1718
"itk/", // Integration Test Kit agent
1819
"tck/", // TCK test suite
1920
"tests/", // Integration tests

boms/sdk/src/it/sdk-usage-test/src/main/java/org/a2aproject/sdk/test/SdkBomVerifier.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class SdkBomVerifier extends DynamicBomVerifier {
1414
private static final Set<String> SDK_EXCLUSIONS = Set.of(
1515
"boms/", // BOM test modules themselves
1616
"examples/", // Example applications
17+
"integrations/spring-boot/", // Spring Boot integration tree is tested separately
1718
"itk/", // Integration Test Kit agent
1819
"tck/", // TCK test suite
1920
"compat-0.3/tck/", // Compat 0.3 TCK (not yet enabled)

boms/test-utils/src/main/java/org/a2aproject/sdk/bom/test/DynamicBomVerifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Base class for dynamically discovering and verifying all classes in a BOM can be loaded.
1515
* Subclass this and pass BOM-specific exclusions and forbidden paths to the constructor.
1616
*
17-
* - Excluded paths: Not tested at all (e.g., boms/, examples/, tck/, tests/)
17+
* - Excluded paths: Not tested at all (e.g., boms/, examples/, integrations/spring-boot/, tck/, tests/)
1818
* - Forbidden paths: Must NOT be loadable (proves BOM doesn't include wrong dependencies)
1919
* - Required paths: Must be loadable (everything else)
2020
*/

examples/spring-boot/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# A2A Java SDK - Spring Boot Examples
2+
3+
This directory contains runnable Spring Boot examples for the A2A Java SDK.
4+
5+
## Layout
6+
7+
- `rest/`
8+
- REST transport examples.
9+
- Currently includes runnable server and client examples.
10+
- `server/`
11+
- Runnable Spring Boot REST server example.
12+
- `client/`
13+
- Runnable Spring Boot REST client example.
14+
- `jsonrpc/`
15+
- Reserved for future JSON-RPC examples.
16+
- `server/`
17+
- Reserved for a future Spring Boot JSON-RPC server example.
18+
- `client/`
19+
- Reserved for a future Spring Boot JSON-RPC client example.
20+
- `grpc/`
21+
- Reserved for future gRPC examples.
22+
- `server/`
23+
- Reserved for a future Spring Boot gRPC server example.
24+
- `client/`
25+
- Reserved for a future Spring Boot gRPC client example.
26+
27+
## Current Example
28+
29+
- `rest/server`
30+
- Demonstrates a runnable A2A server built with the Spring Boot REST starter.
31+
- Exposes the standard A2A REST endpoints.
32+
- `rest/client`
33+
- Demonstrates a runnable Spring Boot client that calls the server and logs the response.
34+
35+
## Run
36+
37+
The REST example can be started in two terminals:
38+
39+
```bash
40+
mvn -pl examples/spring-boot/rest/server -am spring-boot:run
41+
```
42+
43+
```bash
44+
mvn -pl examples/spring-boot/rest/client -am spring-boot:run
45+
```
46+
47+
The server listens on `http://localhost:18080` and the client connects to that URL by default.
48+
49+
## Endpoint Preview
50+
51+
Once running, the example exposes:
52+
53+
- `/.well-known/agent-card.json`
54+
- `POST /message:send`
55+
- `POST /message:stream`
56+
- `GET /tasks/{taskId}`
57+
- `GET /tasks`
58+
- `POST /tasks/{taskId}:cancel`
59+
- `POST /tasks/{taskId}:subscribe`
60+
- `POST /tasks/{taskId}/pushNotificationConfigs`
61+
- `GET /tasks/{taskId}/pushNotificationConfigs/{configId}`
62+
- `GET /tasks/{taskId}/pushNotificationConfigs`
63+
- `DELETE /tasks/{taskId}/pushNotificationConfigs/{configId}`
64+
- `GET /extendedAgentCard`
65+
66+
## Next Transport Examples
67+
68+
The example tree is transport-first so `jsonrpc` and `grpc` can be added later as sibling transport roots.
69+
70+
## Build
71+
72+
```bash
73+
mvn -pl examples/spring-boot -am test
74+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A2A Java SDK - Spring Boot gRPC Examples
2+
3+
Reserved for future Spring Boot gRPC examples.
4+
5+
## Build
6+
7+
No buildable module exists yet. When it is added, use:
8+
9+
```bash
10+
mvn -pl examples/spring-boot/grpc -am test
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A2A Java SDK - Spring Boot gRPC Client Example
2+
3+
Reserved for a future Spring Boot gRPC client example.
4+
5+
## Build
6+
7+
No buildable module exists yet. When it is added, use:
8+
9+
```bash
10+
mvn -pl examples/spring-boot/grpc/client -am test
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A2A Java SDK - Spring Boot gRPC Server Example
2+
3+
Reserved for a future Spring Boot gRPC server example.
4+
5+
## Build
6+
7+
No buildable module exists yet. When it is added, use:
8+
9+
```bash
10+
mvn -pl examples/spring-boot/grpc/server -am test
11+
```

0 commit comments

Comments
 (0)