Skip to content

Commit 82be0b7

Browse files
committed
Add a blog post about the A2A Java SDK 0.3.0.Beta1 release
1 parent d19e2e2 commit 82be0b7

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
layout: post
3+
title: 'REST Transport Now Supported for the A2A Java SDK'
4+
date: 2025-09-15
5+
tags: ai a2a
6+
synopsis: 'Today, we released A2A Java SDK 0.3.0.Beta1 which adds support for the HTTP+JSON/REST transport.'
7+
author: fjuma
8+
---
9+
10+
Today, we've released A2A Java SDK 0.3.0.Beta1 which introduces support for the HTTP+JSON/REST transport.
11+
12+
Our last https://quarkus.io/blog/quarkus-a2a-java-0-3-0-alpha-release/[blog post] covered what's new in the 0.3.0 version of the A2A Java SDK. In this post, we'll focus on how to make use of the new HTTP+JSON/REST transport for both A2A server agents and clients.
13+
14+
== Configuring an A2A Server Agent to Support the REST Transport
15+
16+
To enable your A2A server agent to support communication using HTTP+JSON/REST, add the following dependency:
17+
18+
[NOTE]
19+
====
20+
The `io.github.a2asdk` `groupId` is temporary and will likely change for future releases. Keep an eye on the `a2a-java` https://github.com/a2aproject/a2a-java/blob/main/README.md[README] for up-to-date documentation.
21+
====
22+
23+
[source,xml]
24+
----
25+
<dependency>
26+
<groupId>io.github.a2asdk</groupId>
27+
<artifactId>a2a-java-sdk-reference-rest</artifactId> <1>
28+
</dependency>
29+
----
30+
31+
<1> `a2a-java-sdk-reference-rest` provides access to the core classes that make up the A2A specification and provides the HTTP endpoints that implement the A2A protocol using the HTTP+JSON/REST transport.
32+
33+
After adding this dependency, simply update your agent card to declare support for this new transport:
34+
35+
[source,java]
36+
----
37+
@Produces
38+
@PublicAgentCard
39+
public AgentCard agentCard() {
40+
return new AgentCard.Builder()
41+
.url(YOUR_HTTP_JSON_URL) <1>
42+
.preferredTransport(TransportProtocol.HTTP_JSON.asString()) <2>
43+
.additionalInterfaces(List.of(
44+
new AgentInterface(TransportProtocol.HTTP_JSON.asString(),
45+
YOUR_HTTP_JSON_URL) <3>
46+
))
47+
...
48+
.build();
49+
}
50+
----
51+
52+
<1> This is the primary URL for your A2A server agent. This should be the URL for your preferred transport (e.g., `http://localhost:8080`).
53+
<2> Your A2A server agent's preferred transport, HTTP+JSON/REST in this example.
54+
<3> The `additionalInterfaces` must contain an entry for the preferred transport. Optionally, any other transports you'd like to support (e.g., `TransportProtocol.JSONRPC.asString()` or `TransportProtocol.GRPC.asString()`) can be specified here too.
55+
56+
For more details on configuring your A2A server agent to support multiple transports, refer to our previous https://quarkus.io/blog/quarkus-a2a-java-0-3-0-alpha-release/[blog post].
57+
58+
== Configuring an A2A Client to Support the REST Transport
59+
60+
To get your A2A client to communicate using the HTTP+JSON/REST transport, you'll need to add a couple
61+
dependencies.
62+
63+
First, add the `a2a-java-sdk-client` dependency to your project. This will provide access to a `Builder` that you can use to create your A2A `Client`.
64+
65+
[source,xml]
66+
----
67+
<dependency>
68+
<groupId>io.github.a2asdk</groupId>
69+
<artifactId>a2a-java-sdk-client</artifactId> <1>
70+
</dependency>
71+
----
72+
73+
Next, add the specific dependency for the HTTP+JSON/REST transport:
74+
75+
[source,xml]
76+
----
77+
<dependency>
78+
<groupId>io.github.a2asdk</groupId>
79+
<artifactId>a2a-java-sdk-client-transport-rest</artifactId>
80+
</dependency>
81+
----
82+
83+
You can now use `Client.builder()` to create a `Client` that supports the HTTP+JSON/REST transport using the `withTransport` method as shown below:
84+
85+
[source,java]
86+
----
87+
// Create the client using the builder
88+
Client client = Client
89+
.builder(agentCard)
90+
.withTransport(RestTransport.class, new RestTransportConfig()) <1>
91+
....
92+
.build();
93+
----
94+
<1> This specifies that our client can support the HTTP+JSON/REST transport. At least one transport must be configured using the `withTransport` method.
95+
96+
For a deep dive into creating clients with the `Client.Builder`, check out this https://quarkus.io/blog/quarkus-a2a-java-0-3-0-alpha-release/[post].
97+
98+
== Conclusion
99+
100+
With the release of A2A Java SDK 0.3.0.Beta1, building flexible, interoperable multi-agent systems just got easier with the new support for the HTTP+JSON/REST transport.
101+
102+
=== Further Reading
103+
104+
* https://quarkus.io/blog/quarkus-a2a-java-0-3-0-alpha-release/[Getting Started with Quarkus and A2A Java SDK 0.3.0]
105+
* https://github.com/a2aproject/a2a-samples/tree/main/samples/java/agents[A2A Java SDK Samples]
106+
* https://github.com/a2aproject/a2a-java/blob/main/README.md[A2A Java SDK Documentation]
107+
* https://a2a-protocol.org/latest/specification/[A2A Specification]
108+
109+

0 commit comments

Comments
 (0)