Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:fix javaagent2023 could not start by bootstrap.yml #189

Merged
merged 5 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@

<dependencies>
<!-- 简单的 Spring Cloud Web 依赖 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ public EchoController(RestTemplate restTemplate, Registration registration) {
this.registration = registration;
}

// @GetMapping("/echo/{str}")
// public ResponseEntity<String> rest(@PathVariable String str) {
// String content = String.format("%s[%d] -> ", registration.getServiceId(), port);
// ResponseEntity<String> response = template.getForEntity("http://service-provider-2023/echo/" + str +"123",
// String.class);
// content += response.getBody();
// return new ResponseEntity<>(content, HttpStatus.OK);
// }

@GetMapping("/echo/{str}")
public ResponseEntity<String> rest(@PathVariable String str) {
String content = String.format("%s[%d] -> ", registration.getServiceId(), port);
ResponseEntity<String> response = template.getForEntity("http://service-provider-2023/echo/" + str +"123",
ResponseEntity<String> response = template.getForEntity("http://service-provider-2023/echo/" + str,
String.class);
content += response.getBody();
return new ResponseEntity<>(content, HttpStatus.OK);
return response;
}

@GetMapping("/custom/config")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
server:
port: 65101

spring:
application:
name: service-consumer-2023
cloud:
nacos:
discovery:
enabled: false
server-addr: 127.0.0.1:8848
config:
enabled: true
serverAddr: 127.0.0.1:8848
username: 'nacos'
password: 'nacos'
config:
import:
- nacos:service-consumer-2023.properties?refreshEnabled=true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
logging:
level:
com.alibaba.cloud.nacos.configdata: debug
#server:
# port: 65101
#
#spring:
# application:
# name: service-consumer-2023
# cloud:
# nacos:
# discovery:
# enabled: false
# server-addr: 127.0.0.1:8848
# config:
# enabled: false
# serverAddr: 127.0.0.1:8848
# username: 'nacos'
# password: 'nacos'
# main:
# allow-bean-definition-overriding: true
## config:
## import:
## - nacos:service-consumer-2023.properties?refreshEnabled=true
#management:
# endpoint:
# health:
# show-details: always
# endpoints:
# web:
# exposure:
# include: '*'
#logging:
# level:
# com.alibaba.cloud.nacos.configdata: debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
server:
port: 65101

spring:
application:
name: service-consumer-2023
cloud:
nacos:
discovery:
enabled: false
server-addr: 127.0.0.1:8848
config:
enabled: false
serverAddr: 127.0.0.1:8848
username: 'nacos'
password: 'nacos'
main:
allow-bean-definition-overriding: true
# config:
# import:
# - nacos:service-consumer-2023.properties?refreshEnabled=true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
logging:
level:
com.alibaba.cloud.nacos.configdata: debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
consumer:
serviceRouter:
plugin:
# 设置就近路由插件配置
nearbyBasedRouter:
# 描述:就近路由的最小匹配级别,需要显示设置
# 范围: zone(腾讯云地域信息,eg: ap-guangzhou)、campus(腾讯云可用区, eg: ap-guangzhou-3)
matchLevel: campus
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@

<dependencies>
<!-- 简单的 Spring Cloud Web 依赖 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
server:
port: 65100

spring:
application:
name: service-provider-2023
cloud:
nacos:
username: 'nacos'
password: 'nacos'
discovery:
enabled: false
server-addr: 127.0.0.1:8848
config:
enabled: true
serverAddr: 127.0.0.1:8848
username: 'nacos'
password: 'nacos'
config:
import:
- nacos:service-provider-2023.properties?refreshEnabled=true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
logging:
level:
com.alibaba.cloud.nacos.configdata: debug
#server:
# port: 65100
#
#spring:
# application:
# name: service-provider-2023
# cloud:
# nacos:
# username: 'nacos'
# password: 'nacos'
# discovery:
# enabled: false
# server-addr: 127.0.0.1:8848
# config:
# enabled: false
# serverAddr: 127.0.0.1:8848
# username: 'nacos'
# password: 'nacos'
## config:
## import:
## - nacos:service-provider-2023.properties?refreshEnabled=true
#management:
# endpoint:
# health:
# show-details: always
# endpoints:
# web:
# exposure:
# include: '*'
#logging:
# level:
# com.alibaba.cloud.nacos.configdata: debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
server:
port: 65100

spring:
application:
name: service-provider-2023
cloud:
nacos:
username: 'nacos'
password: 'nacos'
discovery:
enabled: false
server-addr: 127.0.0.1:8848
config:
enabled: false
serverAddr: 127.0.0.1:8848
username: 'nacos'
password: 'nacos'
# config:
# import:
# - nacos:service-provider-2023.properties?refreshEnabled=true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
logging:
level:
com.alibaba.cloud.nacos.configdata: debug
Loading