Package io.agentscope.spring.boot.nacos
Class AgentscopeA2aNacosAutoConfiguration
java.lang.Object
io.agentscope.spring.boot.nacos.AgentscopeA2aNacosAutoConfiguration
- All Implemented Interfaces:
Closeable,AutoCloseable
@AutoConfiguration
@EnableConfigurationProperties({AgentScopeNacosProperties.class,AgentScopeA2aNacosProperties.class})
@ConditionalOnProperty(prefix="agentscope.a2a.nacos",
name="enabled",
havingValue="true",
matchIfMissing=false)
public class AgentscopeA2aNacosAutoConfiguration
extends Object
implements Closeable
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
ConstructorsConstructorDescriptionAgentscopeA2aNacosAutoConfiguration(AgentScopeNacosProperties nacosProperties, AgentScopeA2aNacosProperties a2aNacosProperties) Constructs a new instance ofAgentscopeA2aNacosAutoConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the Nacos A2A service by shutting it down.io.agentscope.core.a2a.agent.card.AgentCardResolverCreates a bean for resolving agent cards from Nacos.io.agentscope.core.a2a.server.registry.AgentRegistrynacosAgentRegistry(AgentScopeA2aNacosProperties a2aNacosProperties) Creates a bean for registering agents to Nacos.
-
Constructor Details
-
AgentscopeA2aNacosAutoConfiguration
public AgentscopeA2aNacosAutoConfiguration(AgentScopeNacosProperties nacosProperties, AgentScopeA2aNacosProperties a2aNacosProperties) throws com.alibaba.nacos.api.exception.NacosException Constructs a new instance ofAgentscopeA2aNacosAutoConfiguration.- Parameters:
nacosProperties- the basic Nacos propertiesa2aNacosProperties- the A2A Nacos properties- Throws:
com.alibaba.nacos.api.exception.NacosException- if there is an error creating the Nacos A2A service
-
-
Method Details
-
close
Closes the Nacos A2A service by shutting it down.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if there is an error during the shutdown process
-
nacosAgentCardResolver
@Bean @ConditionalOnProperty(prefix="agentscope.a2a.nacos.discovery", name="enabled", havingValue="true", matchIfMissing=true) public io.agentscope.core.a2a.agent.card.AgentCardResolver nacosAgentCardResolver()Creates a bean for resolving agent cards from Nacos.- Returns:
- an instance of
NacosAgentCardResolver
-
nacosAgentRegistry
@Bean @ConditionalOnProperty(prefix="agentscope.a2a.nacos.registry", name="enabled", havingValue="true", matchIfMissing=true) public io.agentscope.core.a2a.server.registry.AgentRegistry nacosAgentRegistry(AgentScopeA2aNacosProperties a2aNacosProperties) Creates a bean for registering agents to Nacos.- Parameters:
a2aNacosProperties- the A2A Nacos properties- Returns:
- an instance of
NacosAgentRegistry
-