AgentscopeA2aNacosAutoConfiguration
@AutoConfiguration @EnableConfigurationProperties({ AgentScopeNacosProperties.class, AgentScopeA2aNacosProperties.class }) @ConditionalOnProperty( prefix = NacosConstants.A2A_NACOS_PREFIX, name = "enabled", havingValue = "true", matchIfMissing = false) public class AgentscopeA2aNacosAutoConfiguration implements Closeable
io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:48–147Agentscope A 2 a Nacos Auto 配置,保存相关配置项。位于 io.agentscope.spring.boot.nacos 包,实现 Closeable。核心成员包括 close、nacosAgentCardResolver、nacosAgentRegistry、AgentscopeA2aNacosAutoConfiguration。
Spring Boot autoconfiguration that exposes A2A Nacos beans for AgentScope.
This AutoConfiguration will create a nacos client AiService to do A2A discovery and registry. This is to
avoid conflicts with the Nacos client in the MCP registry center, which would otherwise prevent the configuration of different
Nacos clusters to handle A2A and MCP separately.
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void close() throws IOException | 关闭连接并释放相关资源。 Closes the Nacos A2A service by shutting it down. |
public AgentCardResolver nacosAgentCardResolver() | 返回 `nacosAgentCardResolver` 结果。 Creates a bean for resolving agent cards from Nacos. |
public AgentRegistry nacosAgentRegistry(AgentScopeA2aNacosProperties a2aNacosProperties) | 设置该参数。 Creates a bean for registering agents to Nacos. |
构造器详情Constructor Detail
AgentscopeA2aNacosAutoConfiguration
public AgentscopeA2aNacosAutoConfiguration(AgentScopeNacosProperties nacosProperties, AgentScopeA2aNacosProperties a2aNacosProperties) throws NacosException
初始化 AgentscopeA2aNacosAutoConfiguration 实例。
Constructs a new instance of AgentscopeA2aNacosAutoConfiguration.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
nacosProperties | AgentScopeNacosProperties | Nacos 属性(类型 `AgentScopeNacosProperties`)。the basic Nacos properties |
a2aNacosProperties | AgentScopeA2aNacosProperties | a 2 a Nacos 属性(类型 `AgentScopeA2aNacosProperties`)。the A2A Nacos properties |
NacosException可能抛出 `NacosException`。Thrown when the operation cannot be completed.
io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:72–77方法详情Method Detail
close
public void close() throws IOException
关闭连接并释放相关资源。
Closes the Nacos A2A service by shutting it down.
IOException可能抛出 `IOException`。Thrown when the operation cannot be completed.
io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:93–103nacosAgentCardResolver
public AgentCardResolver nacosAgentCardResolver()
返回 nacosAgentCardResolver 结果。
Creates a bean for resolving agent cards from Nacos.
AgentCardResolverio/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:110–118nacosAgentRegistry
public AgentRegistry nacosAgentRegistry(AgentScopeA2aNacosProperties a2aNacosProperties)
设置该参数。
Creates a bean for registering agents to Nacos.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
a2aNacosProperties | AgentScopeA2aNacosProperties | a 2 a Nacos 属性(类型 `AgentScopeA2aNacosProperties`)。the A2A Nacos properties |
AgentRegistryio/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:126–136