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 Details

    • AgentscopeA2aNacosAutoConfiguration

      public AgentscopeA2aNacosAutoConfiguration(AgentScopeNacosProperties nacosProperties, AgentScopeA2aNacosProperties a2aNacosProperties) throws com.alibaba.nacos.api.exception.NacosException
      Constructs a new instance of AgentscopeA2aNacosAutoConfiguration.
      Parameters:
      nacosProperties - the basic Nacos properties
      a2aNacosProperties - the A2A Nacos properties
      Throws:
      com.alibaba.nacos.api.exception.NacosException - if there is an error creating the Nacos A2A service
  • Method Details

    • close

      @PreDestroy public void close() throws IOException
      Closes the Nacos A2A service by shutting it down.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      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