Skip to content

Conversation

@kabir
Copy link
Collaborator

@kabir kabir commented Nov 20, 2025

Default values will now be used by default. You can supply your own by providing a CDI bean with a higher priority.
Also, there is a new a2a-java-sdk-microprofile-config with the previous MicroProfile Config capabilities. If used, this will allow MicroProfile Config configurations of the properties. The reference implementations use this new module

Fixes #467 🦕

Upstream: #468

a2aproject#468)

Default values will now be used by default. You can supply your own by
providing a CDI bean with a higher priority.
Also, there is a new 2a-java-sdk-microprofile-config with the previous
MicroProfile Config capabilities. If used, this will allow MicroProfile
Config configurations of the properties. The reference implementations
use this new module

Fixes a2aproject#467 🦕
@kabir kabir added the 0.3.x label Nov 20, 2025
@kabir kabir changed the title feat!: Remove hard dependency on MicroProfile Config from the core SDK (#468) feat!: Remove hard dependency on MicroProfile Config from the core SDK Nov 20, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kabir, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the configuration management within the A2A Java SDK. The primary goal is to remove the direct dependency on MicroProfile Config from the core SDK, making it more modular and adaptable to various environments. This is achieved by introducing a new, flexible configuration provider interface and a default implementation that loads properties from classpath resources. An optional integration module is provided for users who still want to leverage MicroProfile Config, ensuring backward compatibility for existing reference implementations while offering greater choice for new integrations.

Highlights

  • Core SDK Decoupling: The core SDK no longer has a hard dependency on MicroProfile Config, enhancing flexibility and reducing framework lock-in.
  • New Configuration System: Introduced a new "A2AConfigProvider" interface and "DefaultValuesConfigProvider" to manage configuration, loading defaults from "META-INF/a2a-defaults.properties" files.
  • MicroProfile Config Integration Module: A new optional module, "a2a-java-sdk-microprofile-config", has been added to provide MicroProfile Config capabilities for those who wish to use it, with a fallback to the new default system.
  • Updated Configuration Usage: Core components like "JpaDatabaseTaskStore", "DefaultRequestHandler", and "AsyncExecutorProducer" now use the new "A2AConfigProvider" for property injection.
  • Enhanced Documentation: The main "README.md" has been updated to clearly explain the new configuration system and how to customize it.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and well-executed refactoring to decouple the core SDK from a hard dependency on MicroProfile Config. The new A2AConfigProvider interface and the DefaultValuesConfigProvider create a flexible and extensible configuration system, which is a great improvement for framework interoperability. The addition of the a2a-java-sdk-microprofile-config module is a thoughtful way to provide backward compatibility for existing users. The changes are well-documented in the READMEs and are accompanied by solid unit tests.

My review comments focus on a consistent maintainability improvement across the newly modified classes: replacing hardcoded configuration key strings with static final constants. This will make the code more robust and easier to maintain.

Comment on lines 38 to +55
@Inject
@ConfigProperty(name = "a2a.replication.grace-period-seconds", defaultValue = "15")
A2AConfigProvider configProvider;

/**
* Grace period for task finalization in replicated scenarios (seconds).
* After a task reaches a final state, this is the minimum time to wait before cleanup
* to allow replicated events to arrive and be processed.
* <p>
* Property: {@code a2a.replication.grace-period-seconds}<br>
* Default: 15<br>
* Note: Property override requires a configurable {@link A2AConfigProvider} on the classpath.
*/
long gracePeriodSeconds;

@PostConstruct
void initConfig() {
gracePeriodSeconds = Long.parseLong(configProvider.getValue("a2a.replication.grace-period-seconds"));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic strings, it's best to declare the configuration key as a private static final String constant. This prevents typos and makes it easier to manage keys.

Suggested change
@Inject
@ConfigProperty(name = "a2a.replication.grace-period-seconds", defaultValue = "15")
A2AConfigProvider configProvider;
/**
* Grace period for task finalization in replicated scenarios (seconds).
* After a task reaches a final state, this is the minimum time to wait before cleanup
* to allow replicated events to arrive and be processed.
* <p>
* Property: {@code a2a.replication.grace-period-seconds}<br>
* Default: 15<br>
* Note: Property override requires a configurable {@link A2AConfigProvider} on the classpath.
*/
long gracePeriodSeconds;
@PostConstruct
void initConfig() {
gracePeriodSeconds = Long.parseLong(configProvider.getValue("a2a.replication.grace-period-seconds"));
}
@Inject
A2AConfigProvider configProvider;
private static final String REPLICATION_GRACE_PERIOD_SECONDS_KEY = "a2a.replication.grace-period-seconds";
/**
* Grace period for task finalization in replicated scenarios (seconds).
* After a task reaches a final state, this is the minimum time to wait before cleanup
* to allow replicated events to arrive and be processed.
* <p>
* Property: {@code a2a.replication.grace-period-seconds}<br>
* Default: 15<br>
* Note: Property override requires a configurable {@link A2AConfigProvider} on the classpath.
*/
long gracePeriodSeconds;
@PostConstruct
void initConfig() {
gracePeriodSeconds = Long.parseLong(configProvider.getValue(REPLICATION_GRACE_PERIOD_SECONDS_KEY));
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix upstream. It was already reviewed and merged there

Comment on lines +124 to +130
@PostConstruct
void initConfig() {
agentCompletionTimeoutSeconds = Integer.parseInt(
configProvider.getValue("a2a.blocking.agent.timeout.seconds"));
consumptionCompletionTimeoutSeconds = Integer.parseInt(
configProvider.getValue("a2a.blocking.consumption.timeout.seconds"));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic strings, it's best to declare configuration keys as constants. Ideally, these would be private static final String fields on the class. This prevents typos and centralizes the key definitions.

    @PostConstruct
    void initConfig() {
        final String AGENT_TIMEOUT_KEY = "a2a.blocking.agent.timeout.seconds";
        final String CONSUMPTION_TIMEOUT_KEY = "a2a.blocking.consumption.timeout.seconds";
        agentCompletionTimeoutSeconds = Integer.parseInt(
                configProvider.getValue(AGENT_TIMEOUT_KEY));
        consumptionCompletionTimeoutSeconds = Integer.parseInt(
                configProvider.getValue(CONSUMPTION_TIMEOUT_KEY));
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix upstream. It was already reviewed and merged there

@kabir kabir merged commit 19d5b40 into a2aproject:0.3.x Nov 20, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant