Skip to content

Commit 72c956a

Browse files
committed
A2A project launches Java SDK
1 parent c615322 commit 72c956a

File tree

3 files changed

+313
-0
lines changed

3 files changed

+313
-0
lines changed

_data/authors.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,3 +612,10 @@ lmolteni:
612612
job_title: "Principal Software Engineer"
613613
twitter: "volothamp"
614614
bio: "Principal Software Engineer at Red Hat / IBM"
615+
maeste:
616+
name: "Stefano Maestri"
617+
618+
emailhash: "c97a0cf6b2f42295f8bfa8670ada8f63"
619+
job_title: "Senior Engineering Manager"
620+
twitter: "maeste"
621+
bio: "Senior Engineering Manager at Red Hat / IBM with an old passion for Open Source and more recent one for AI Engineering."
Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
---
2+
layout: post
3+
title: 'Quarkus and WildFly teams from Red Hat collaborating with Google on launch of Agent2Agent Java SDK'
4+
date: 2025-06-27
5+
tags: release
6+
synopsis: 'We’re thrilled to announce the launch of the Agent2Agent (A2A) Java SDK, made possible by WildFly and Quarkus teams’ contribution.'
7+
author: maeste
8+
---
9+
:imagesdir: /assets/images/posts/a2a-announce
10+
11+
The agent revolution just took a massive leap forward! Following the
12+
recent landmark https://developers.googleblog.com/en/google-cloud-donates-a2a-to-linux-foundation/[announcement] that Google has donated the Agent2Agent
13+
(A2A) protocol to the Linux Foundation, we’re thrilled to announce the
14+
launch of the https://github.com/a2aproject/a2a-java[A2A Java SDK], built by WildFly and Quarkus teams in close collaboration, and now contributed to the official A2A project.
15+
16+
17+
== A New Era Under Linux Foundation Stewardship
18+
19+
The https://a2aproject.github.io/A2A/latest/specification[A2A] protocol’s transition to the Linux Foundation represents more
20+
than just a change of governance: it’s a commitment to vendor-neutral,
21+
community-driven innovation. Similar how WildFly and Quarkus both recently joined CommonHaus foundation. This ensures A2A as a critical interoperability
22+
standard remains open and accessible to all. With more than 100
23+
companies now supporting the protocol, we’re witnessing the formation of
24+
what industry leaders are calling "`an open, interoperable Internet of
25+
Agents.`"
26+
With the A2A Java SDK now part of this movement, enterprise developers can participate in this open agent ecosystem from day one.
27+
28+
== Why Java SDK Matters
29+
30+
Here’s where things get exciting from a technical perspective: *true
31+
polyglot agent ecosystems*.
32+
33+
The agent landscape has been fragmented, with Python dominating AI/ML
34+
workflows, JavaScript powering web-based agents, and Java serving as the
35+
backbone of enterprise backend systems. Each language ecosystem operated
36+
potential of multi-agent systems and agentic architectures.
37+
38+
39+
Our Java SDK shatters these barriers by implementing the A2A protocol
40+
specification natively in Java, enabling:
41+
42+
* *Enterprise-grade agent integration* with existing Java
43+
infrastructure +
44+
* *Seamless interoperability* between Java agents and those written in
45+
Python, JavaScript, or any A2A-compatible language +
46+
well-tested enterprise capabilities (including observability, security...)
47+
48+
And you know what? Writing agents in Java is now as easy as writing
49+
50+
=== 1. A class that creates an A2A Agent Card
51+
52+
[source,java]
53+
----
54+
import io.a2a.spec.AgentCapabilities;
55+
import io.a2a.spec.AgentCard;
56+
import io.a2a.spec.AgentSkill;
57+
import io.a2a.spec.PublicAgentCard;
58+
...
59+
60+
@ApplicationScoped
61+
public class WeatherAgentCardProducer {
62+
63+
@Produces
64+
@PublicAgentCard
65+
public AgentCard agentCard() {
66+
return new AgentCard.Builder()
67+
.name("Weather Agent")
68+
.description("Helps with weather")
69+
.url("http://localhost:10001")
70+
.version("1.0.0")
71+
.capabilities(new AgentCapabilities.Builder()
72+
.streaming(true)
73+
.pushNotifications(false)
74+
.stateTransitionHistory(false)
75+
.build())
76+
.defaultInputModes(Collections.singletonList("text"))
77+
.defaultOutputModes(Collections.singletonList("text"))
78+
.skills(Collections.singletonList(new AgentSkill.Builder()
79+
.id("weather_search")
80+
.name("Search weather")
81+
.description("Helps with weather in city, or states")
82+
.tags(Collections.singletonList("weather"))
83+
.examples(List.of("weather in LA, CA"))
84+
.build()))
85+
.build();
86+
}
87+
}
88+
----
89+
90+
=== 2. A class that creates an A2A Agent Executor
91+
92+
[source,java]
93+
----
94+
import io.a2a.server.agentexecution.AgentExecutor;
95+
import io.a2a.server.agentexecution.RequestContext;
96+
import io.a2a.server.events.EventQueue;
97+
import io.a2a.server.tasks.TaskUpdater;
98+
import io.a2a.spec.JSONRPCError;
99+
import io.a2a.spec.Message;
100+
import io.a2a.spec.Part;
101+
import io.a2a.spec.Task;
102+
import io.a2a.spec.TaskNotCancelableError;
103+
import io.a2a.spec.TaskState;
104+
import io.a2a.spec.TextPart;
105+
...
106+
107+
@ApplicationScoped
108+
public class WeatherAgentExecutorProducer {
109+
110+
@Inject
111+
WeatherAgent weatherAgent;
112+
113+
@Produces
114+
public AgentExecutor agentExecutor() {
115+
return new WeatherAgentExecutor(weatherAgent);
116+
}
117+
118+
private static class WeatherAgentExecutor implements AgentExecutor {
119+
120+
private final WeatherAgent weatherAgent;
121+
122+
public WeatherAgentExecutor(WeatherAgent weatherAgent) {
123+
this.weatherAgent = weatherAgent;
124+
}
125+
126+
@Override
127+
public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError {
128+
TaskUpdater updater = new TaskUpdater(context, eventQueue);
129+
130+
// mark the task as submitted and start working on it
131+
if (context.getTask() == null) {
132+
updater.submit();
133+
}
134+
updater.startWork();
135+
136+
// extract the text from the message
137+
String userMessage = extractTextFromMessage(context.getMessage());
138+
139+
// call the weather agent with the user's message
140+
String response = weatherAgent.chat(userMessage);
141+
142+
// create the response part
143+
TextPart responsePart = new TextPart(response, null);
144+
List<Part<?>> parts = List.of(responsePart);
145+
146+
// add the response as an artifact and complete the task
147+
updater.addArtifact(parts, null, null, null);
148+
updater.complete();
149+
}
150+
151+
@Override
152+
public void cancel(RequestContext context, EventQueue eventQueue) throws JSONRPCError {
153+
Task task = context.getTask();
154+
155+
if (task.getStatus().state() == TaskState.CANCELED) {
156+
// task already cancelled
157+
throw new TaskNotCancelableError();
158+
}
159+
160+
if (task.getStatus().state() == TaskState.COMPLETED) {
161+
// task already completed
162+
throw new TaskNotCancelableError();
163+
}
164+
165+
// cancel the task
166+
TaskUpdater updater = new TaskUpdater(context, eventQueue);
167+
updater.cancel();
168+
}
169+
170+
private String extractTextFromMessage(Message message) {
171+
StringBuilder textBuilder = new StringBuilder();
172+
if (message.getParts() != null) {
173+
for (Part part : message.getParts()) {
174+
if (part instanceof TextPart textPart) {
175+
textBuilder.append(textPart.getText());
176+
}
177+
}
178+
}
179+
return textBuilder.toString();
180+
}
181+
}
182+
}
183+
----
184+
185+
Pretty straightforward, right? The SDK provides all the necessary
186+
components to create agent cards, handle agent execution, and manage
187+
communication between agents.
188+
189+
Note: In future some of this boiler plate code we expect will be simplified by Quarkus and other frameworks using the A2A Java SDK.
190+
191+
And when it comes to client-side development, it's even easier. The SDK
192+
includes a simple HTTP client that allows you to interact with A2A agents
193+
using the A2A protocol. This client abstracts away the complexities of
194+
the protocol, making it easy to send messages, receive responses, and
195+
manage agent interactions. Creating an A2A client in Java is as simple as:
196+
197+
=== 1. Create an A2A client
198+
199+
[source,java]
200+
----
201+
// Create an A2AClient (the URL specified is the server agent's URL, be sure to replace it with the actual URL of the A2A server you want to connect to)
202+
A2AClient client = new A2AClient("http://localhost:1234");
203+
----
204+
205+
=== 2. Send a message to the A2A server agent
206+
207+
[source,java]
208+
----
209+
// Send a text message to the A2A server agent
210+
Message message = A2A.toUserMessage("tell me a joke"); // the message ID will be automatically generated for you
211+
MessageSendParams params = new MessageSendParams.Builder()
212+
.message(message)
213+
.build();
214+
SendMessageResponse response = client.sendMessage(params);
215+
----
216+
217+
Note that `+A2A#toUserMessage+` will automatically generate a message ID
218+
for you when creating the `+Message+` if you don’t specify it. You can
219+
also explicitly specify a message ID like this:
220+
221+
[source,java]
222+
----
223+
Message message = A2A.toUserMessage("tell me a joke", "message-1234"); // messageId is message-1234
224+
----
225+
226+
And the SDK also provides a convenient way to handle task management,
227+
allowing you to create, get the current state, and cancel tasks with ease. This is
228+
especially useful for managing long-running operations or coordinating
229+
complex workflows between multiple agents. You can find more details
230+
about task management and many other features in the *https://github.com/a2aproject/a2a-java[A2A Java SDK]* repository's.
231+
232+
You just want more code? Are you interested to see interoperability in action? Explore our
233+
https://github.com/a2aproject/a2a-samples/tree/main/samples/multi_language/python_and_java_multiagent[multi-language
234+
sample implementation&#44;] which demonstrates how Python and Java
235+
agents collaborate seamlessly. See this picture for a bird-eye overview,
236+
and checkout the code for more insights
237+
238+
image::a2a-agentic.png[scaledwidth=100%]
239+
240+
== Technical Excellence: The Mutiny-Zero Advantage
241+
242+
And if you need your agent to be reactive, don't worry about the dependencies you are adding, because
243+
the Java SDK leverages *mutiny-zero* as its reactive foundation, a
244+
decision that reflects our commitment to framework-agnostic excellence.
245+
https://smallrye.io/smallrye-mutiny-zero/latest/[Mutiny Zero] is a minimal API for creating reactive streams-compliant
246+
publishers that weighs less than 50K and have **zero** external dependencies
247+
beyond the Reactive Streams API. This architecture delivers several
248+
compelling advantages:
249+
250+
* *Zero Vendor Lock-in*: No specific technology commitments for your
251+
agents. +
252+
* *Lightweight Performance*: Faster startups, reduced resource
253+
consumption. +
254+
* *Maximum Compatibility*: Seamless integration with existing Java
255+
reactive ecosystems. +
256+
* *Future-Proof Design*: Ready for Java’s modern Flow APIs, backward
257+
compatible.
258+
259+
This reactive foundation ensures your Java agents can handle
260+
high-throughput, low-latency agent-to-agent communications while
261+
remaining lightweight and composable.
262+
263+
== Community-Driven Innovation
264+
265+
What started as an external contribution has now become an official part
266+
of the A2A project repository, showcasing how the ecosystem can rapidly
267+
evolve through diverse contributions. This is precisely the kind of
268+
collaborative development that will accelerate A2A adoption and
269+
innovation.
270+
271+
Ready to dive in? Here’s your roadmap:
272+
273+
[arabic]
274+
. *Explore the SDK*: Visit
275+
https://github.com/a2aproject/a2a-java[github.com/a2aproject/a2a-java]
276+
to examine the implementation +
277+
. *Study Real Examples*: Check out the
278+
https://github.com/a2aproject/a2a-samples/tree/main/samples/multi_language/python_and_java_multiagent[multi-language
279+
samples] to see interoperability in action +
280+
. *Join the Community*: Connect with fellow developers in the A2A
281+
ecosystem +
282+
. *Start Building*: Begin prototyping your first multi-language agent
283+
team
284+
285+
== The Bigger Picture: Collaborative Intelligence
286+
287+
The A2A protocol aims to break down the silos that currently limit the
288+
potential of aAI infuse applications by providing a common language for
289+
AI agents to discover each other’s capabilities, securely exchange
290+
information, and coordinate complex tasks.
291+
292+
With Java now joining Python and JavaScript in the A2A ecosystem, we’re
293+
building towards a future where intelligence is truly collaborative,
294+
where the most sophisticated AI systems are assembled from specialized
295+
agents, each optimized for specific tasks but unified through
296+
standardized communication protocols.
297+
298+
This Java SDK launch is just the beginning. The A2A project under Linux
299+
Foundation stewardship is positioned for rapid expansion, with
300+
additional language implementations, enhanced security features, and
301+
enterprise-grade tooling on the horizon.
302+
303+
*Your contributions matter*. Whether you’re fixing bugs, adding
304+
features, creating examples, or building integrations with other frameworks — every commithelps build this collaborative future.
305+
The agent revolution is here, and with the A2A Java SDK, the entire Java
306+
ecosystem can participate. Let’s build something amazing together! 🚀
63.3 KB
Loading

0 commit comments

Comments
 (0)