|
Warning
|
This is an unsupported experimental POC implementation. Use with caution. |
A WildFly feature-pack implementing the open-standard Agent2Agent (A2A) Protocol to enable universal interoperability and seamless collaboration between AI agents across diverse frameworks and vendors.
About the A2A Protocol
The Agent2Agent (A2A) protocol addresses a critical challenge in the AI landscape: enabling gen AI agents, built on diverse frameworks by different companies running on separate servers, to communicate and collaborate effectively - as agents, not just as tools. A2A aims to provide a common language for agents, fostering a more interconnected, powerful, and innovative AI ecosystem.
With A2A, agents can:
-
Discover each other’s capabilities.
-
Negotiate interaction modalities (text, forms, media).
-
Securely collaborate on long-running tasks.
-
Operate without exposing their internal state, memory, or tools.
Learn more about the protocol in the A2A project, from which this introduction is taken.
Provisioning with Maven
Use the wildfly-maven-plugin to provision WildFly with the A2A feature-pack.
A2A Server with All Transports (JSON-RPC, gRPC, REST)
For gRPC support, include the wildfly-grpc-feature-pack:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>6.0.1.Final</version>
<configuration>
<feature-packs>
<feature-pack>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-galleon-pack</artifactId>
<version>41.0.1.Final</version>
</feature-pack>
<feature-pack>
<groupId>org.wildfly.grpc</groupId>
<artifactId>wildfly-grpc-feature-pack</artifactId>
<version>0.2.1.Final</version>
</feature-pack>
<feature-pack>
<groupId>org.wildfly.a2a</groupId>
<artifactId>wildfly-a2a-feature-pack</artifactId>
<version>0.0.1.Alpha1-SNAPSHOT</version>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
<layer>a2a-core-client</layer> <!-- needed if the agent builds messages with the org.a2aproject.sdk.A2A helper -->
<layer>grpc</layer>
<layer>a2a-server-grpc</layer>
<layer>a2a-server-http-json</layer>
<layer>a2a-server-jsonrpc</layer>
</layers>
<galleon-options>
<jboss-fork-embedded>true</jboss-fork-embedded>
<stability-level>experimental</stability-level>
</galleon-options>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
Provisioning with WildFly Glow
The layers define WildFly Glow rules, so Glow can infer the
layer set from a deployment scan instead of a manually configured <layers> list. The base a2a layer is
discovered from A2A SDK usage in the deployment, and the client transport layers from the transport
class the application uses.
Glow takes feature-packs to scan against from a Galleon provisioning file, not from a command
line coordinate, so start with a feature-packs.xml listing both WildFly and this feature-pack:
<installation xmlns="urn:jboss:galleon:provisioning:4.0">
<feature-pack location="org.wildfly:wildfly-galleon-pack:41.0.1.Final"/>
<feature-pack location="org.wildfly.a2a:wildfly-a2a-feature-pack:0.0.1.Alpha1-SNAPSHOT"/>
</installation>
wildfly-glow scan my-a2a-app.war \
--input-feature-packs-file=feature-packs.xml \
--add-ons=a2a-server-jsonrpc \
--package-stability-level=experimental \
--config-stability-level=experimental \
--provision=SERVER
For now, the stability options are required because all A2A layers are experimental.
Choosing Server Transport with Glow
A deployment that drives A2A purely through the SDK and CDI - an AgentExecutor plus a
@PublicAgentCard producer - carries no information about which server transport to provision.
The three server layers are therefore offered as add-ons of
the a2a-server family (namely a2a-server-jsonrpc, a2a-server-grpc, a2a-server-http-json), selected
with --add-ons. The client layers form the a2a-client family and are additionally auto-detected
from the transport class the application uses.
A deployment that does reference the Jakarta EE implementation classes directly - for example a
JAX-RS resource that extends or calls org.wildfly.a2a.jakarta.jsonrpc.A2AServerResource - is
matched by that server layer’s own class rule, and the layer is discovered without --add-ons.
a2a-server-grpc is not discoverable this way. It is usable only together with the
gRPC feature-pack and its grpc layer,
which no A2A layer can depend on because the feature-pack is optional. Were the layer auto-selected,
Glow would provision a server that resolves and boots but has no gRPC endpoint. Provision it
explicitly, alongside the gRPC feature-pack and the grpc layer.
Layers
The feature-pack provides the following Galleon layers:
| Layer | Description |
|---|---|
|
Base layer with A2A subsystem and common SDK modules |
|
A2A client-side SDK core (client builder, transport SPI and the |
|
A2A server-side SDK core (request handler infrastructure) |
|
A2A client with JSON-RPC 2.0 over HTTP transport |
|
A2A client with gRPC binary protocol transport |
|
A2A client with RESTful HTTP/JSON transport |
|
A2A server with JSON-RPC 2.0 over HTTP transport |
|
A2A server with gRPC binary protocol transport |
|
A2A server with RESTful HTTP/JSON transport |
|
A2A server with the v0.3 JSON-RPC 2.0 over HTTP transport (backward compatibility) |
|
A2A server with the v0.3 gRPC binary protocol transport (backward compatibility) |
|
A2A server with the v0.3 RESTful HTTP/JSON transport (backward compatibility) |
Server layers include both the A2A SDK transport module and the Jakarta EE implementation.
Client layers include only the SDK transport module.
Each transport layer pulls in the core layer it needs, so a2a-core-client and a2a-core-server do not need to be
listed explicitly. The one exception is a server layer set for an agent that builds messages with the
org.a2aproject.sdk.A2A helper, which ships in the client SDK core; Glow discovers that layer on its own.
Protocol version v0.3 backward compatibility
The -0.3 server layers provision the v0.3 compatibility transports from the A2A SDK, which adapt v0.3 requests onto
the v1.0 RequestHandler. They are opt-in: provisioning one of them alongside its v1.0 counterpart makes the server
serve both protocol versions from a single deployment, with requests dispatched on the A2A-Version header.
Note that a v0.3 transport declares itself the default version, so a request that carries no A2A-Version header is
handled as v0.3. The agent card served from /.well-known/agent-card.json always comes from the highest provisioned
version.
Configuration
The A2A SDK reads its configuration through MicroProfile Config, so a deployment overrides a value with a
META-INF/microprofile-config.properties entry, a system property or an environment variable. The a2a layer
provisions the microprofile-config layer for that reason; without it only the SDK’s built-in defaults apply.
# Deny task operations when no TaskAuthorizationProvider is configured (default: true)
a2a.authorization.required=false
# Blocking-call timeouts, in seconds
a2a.blocking.agent.timeout.seconds=30
|
Important
|
Since a2a-java 1.3.0.Final, authorization is fail-closed: a deployment that provides no
org.a2aproject.sdk.server.auth.TaskAuthorizationProvider bean rejects every task operation with
TaskNotFoundError. Provide a TaskAuthorizationProvider, or set a2a.authorization.required=false for
single-user deployments and testing. The full list of properties and their defaults is in
META-INF/a2a-defaults.properties in a2a-java-sdk-server-common.
|
Building
Build the A2A feature-pack:
git clone https://github.com/rhusar/wildfly-a2a-feature-pack.git
cd wildfly-a2a-feature-pack
./mvnw clean install -DskipTests
Running Integration Tests
Based on a2a-jakarta testing approach.
mvn clean install # All tests
mvn clean test -pl testsuite/integration/jsonrpc # JSON-RPC only
mvn clean test -pl testsuite/integration/grpc # gRPC only
mvn clean test -pl testsuite/integration/rest # RESTful HTTP/JSON only
The jsonrpc and rest modules each provision two servers and run their suite against both:
-
target/wildfly-layersfrom the hardcoded layer list, and -
target/wildfly-glowfrom the layer set WildFly.
Glow discovers by scanning the Arquillian deployment.
Both run automatically via mvn clean install.
Results are differentiated by the -layers and -glow suffixes on the surefire reports.
The grpc module provisions only the hardcoded server: it additionally requires the gRPC feature-pack
and its grpc layer, which no A2A layer depends on and which Glow cannot infer from a deployment - see
Choosing Server Transport with Glow.
Code Coverage
Add -Dcoverage to any build to attach the JaCoCo agent to both the test JVMs and the managed WildFly
servers, and to aggregate the results across the reactor:
mvn clean install -Dcoverage
The aggregated HTML report is written to code-coverage/target/site/jacoco-aggregate/index.html.
The report for main is published on every push at
rhusar.github.io/wildfly-a2a-feature-pack/coverage/main.
|
Note
|
The report covers the subsystem unit tests and the integration testsuite only - the TCK runs are
not included, so the reported numbers understate what CI actually exercises. The TCK workflows are
separate runs whose execution data never reaches the coverage job, and the TCK modules define no
server.jvm.args, so their SUT - started by wildfly:start rather than by surefire - carries no
JaCoCo agent to begin with. See Running the TCK.
|
|
Important
|
Enable coverage with -Dcoverage, never with -P coverage-enabled. The profile is activated
by the property because jacoco.server.argLine - the -javaagent argument handed to the managed server -
must not exist as a POM property while coverage is on, or Maven freezes it to its empty default before
prepare-agent ever runs. A -P activation leaves the property unset, so the complementary
coverage-disabled profile stays active too, and the build quietly produces an uninstrumented server
and an empty report.
|
Coverage builds must always include clean: the in-container execution data is appended to across the
layers and Glow server runs of a single build, and nothing truncates it between builds.
Running the TCK
The feature-pack includes a TCK (Technology Compatibility Kit) module that runs the official A2A protocol TCK against WildFly.
Prerequisites
-
Java 17 (or newer)
-
Maven 3.9 (or newer)
-
Python 3.11 (or newer) with
uvpackage manager
Build and Run TCK
-
Build the feature-pack:
mvn clean install
-
Build and provision the TCK server:
mvn package -pl tck/tck-1.0 -am
-
Start the WildFly server:
SUT_HOST=localhost:8080 SUT_GRPC_HOST=localhost:9555 tck/tck-1.0/target/wildfly/bin/standalone.sh --stability=experimental
-
Clone and set up the A2A TCK:
git clone https://github.com/a2aproject/a2a-tck.git
cd a2a-tck
git checkout 1.0.0.alpha3
pip install uv
uv pip install -e .
-
Run the TCK:
uv run ./run_tck.py --sut-host http://localhost:8080 -v
-
Stop the server:
mvn wildfly:shutdown -pl tck/tck-1.0
TCK Endpoints Reference
-
JSON-RPC:
http://localhost:8080 -
REST (HTTP-JSON):
http://localhost:8080 -
gRPC:
localhost:9555(gRPC endpoint provisioned by the FP runs on separate Netty-backed port)
Running the ITK
The itk module is an agent for the A2A Integration Test Kit, which checks
cross-SDK interoperability: a nested instruction is routed through a chain of agents built with different SDKs and
protocol versions, over every transport. The ITK service runs in a container and takes the place of the Java SDK’s
"current" agent with this repository - it builds the module with mvn -Pitk -pl itk -am install and starts the
provisioned server through org.a2aproject.sdk.itk.Main.
Docker or Podman is required. To run the pull request scenarios:
A2A_ITK_REVISION=main itk/run_itk.sh
The module is only part of the build with the itk profile, since it compiles instruction.proto from the a2a-itk
checkout that run_itk.sh clones into itk/a2a-itk.
Resources
-
API Documentation - Javadoc for the
mainbranch -
Code Coverage Report - JaCoCo report for the
mainbranch -
A2A Protocol - Official A2A protocol specification
-
A2A - Reference implementation of the A2A protocol
-
a2a-java - Java SDK for A2A protocol
-
a2a-tck - Official A2A protocol TCK
-
a2a-itk - A2A Integration Test Kit for cross-SDK interoperability
-
a2a-jakarta - Jakarta EE server implementation of A2A Java SDK
-
wildfly-ai-feature-pack - WildFly feature-pack for AI/LLM integration (LangChain4j)