Comments (8)
which version you used?
from nacos.
springboot 3.2.3
com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2023.0.0.0-RC1
com.alibaba.cloud:spring-cloud-alibaba-commons:2023.0.0.0-RC1
org.springframework.cloud:spring-cloud-commons:4.1.0
org.springframework.cloud:spring-cloud-context:4.1.0
com.alibaba.nacos:nacos-client:2.3.0
jdk17.0.10
from nacos.
nacos-server version?
from nacos.
nacos-server version?
2.0.3
from nacos.
nacos-server version?
2.0.3
The old version should have this problem, you can try to upgrade new version, I remember this problem has been fixed.
from nacos.
nacos-server version?
2.0.3The old version should have this problem, you can try to upgrade new version, I remember this problem has been fixed.
i upgrade nacos server to 2.2.3 and try to get instanceId, it's still null
here is my simple code
@SpringBootApplication
public class CloudApplication {
@Autowired
private NacosDiscoveryProperties nacosDiscoveryProperties;
public static void main(String[] args) {
SpringApplication.run(CloudApplication.class, args);
}
@Bean
public NamingService namingService() throws NacosException {
return NamingFactory.createNamingService(nacosDiscoveryProperties.getServerAddr());
}
}
@RestController
@RequestMapping("/test")
public class TestController {
@Autowired
private NamingService namingService;
@Value("${spring.application.name}")
private String applicationName;
@GetMapping("/unique")
public Object unique() throws NacosException {
List<Instance> allInstances = this.namingService.getAllInstances(this.applicationName);
Instance instance = allInstances.get(0);
String instanceId = instance.getInstanceId();
System.out.println("instanceId = " + instanceId);
return allInstances;
}
}
here is the response
[
{
"ip": "my ip address",
"port": 7088,
"weight": 1.0,
"healthy": true,
"enabled": true,
"ephemeral": true,
"clusterName": "DEFAULT",
"serviceName": "DEFAULT_GROUP@@cloud-service",
"metadata": {
"preserved.register.source": "SPRING_CLOUD"
},
"ipDeleteTimeout": 30000,
"instanceHeartBeatInterval": 5000,
"instanceHeartBeatTimeOut": 15000
}
]
and the console output instanceId=null
from nacos.
the latest version is 2.3.2, can you try this version?
from nacos.
the latest version is 2.3.2, can you try this version?
I've get instanceId use 2.3.2 nacos thx
from nacos.
Related Issues (20)
- 我已经更改了nacos的数据存储方式为Mysql,为什么还会在主目录下自动生成一个名为nacos的文件夹 HOT 2
- 使用官方提供的注销nacos实例的api成功调用后nacos上的该服务没有被注销。 HOT 2
- [test] module persistence upgrade to junit5
- [test] module plugin upgrade to junit5
- [test] module plugin-default-impl upgrade to junit5
- [test] module test upgrade to junit5
- There is an inconsistency between Nacos's local configuration information and the database configuration information, and this inconsistency cannot be automatically resolved.
- Luis HOT 1
- After the virtual machine server is suspended, the applications in the server will not be taken offline HOT 2
- In the ResponseExceptionHandler of the naming module, the wrong logging format was used.
- The nacos configuration file for running a single node is empty HOT 2
- 单机模式下 配置有特殊符号 的报错 HOT 4
- After using Nacos to rebuild monthly nodes on the Google Cloud platform, there are occasional instances of continuous service unavailability. HOT 2
- nacos kubernetesspring boot application config and register failed
- 【BUG】命名空间200限制,是显示错误吗 HOT 2
- 2.2.3 Nacos启动约5分钟后,提示StackOverflowError Exception
- 配置管理-配置列表页面的配置总数重复展示
- 如何用 OpenAPI 发布配置接口修改单个配置项? HOT 3
- 如何处理 kubelet 异常,没有删除服务容器,导致 nacos 临时实例无法下线问题
- regular strings cannot be dynamically updated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nacos.