Skip to content

Commit

Permalink
feat:对齐deployment与application中的服务名定义 (#172)
Browse files Browse the repository at this point in the history
* fix: optimize the discovery inject logic and fix nacos config not working issue

* feat: 删除无用的导入

* feat: 增加actuator到demo中

* fix: add lossless healthcheck for example

* fix: add configuration comments

* fix: 修复事件日志不输出的问题

* release: release version to 1.7.0-RC1

* feat: new add java agent for hoxton

* feat: support service registry and config

* feat: refrator all inject logics into BeanInjector

* feat: add gray release example & dispatch bean register into plugins

* feat: add environment parameter to obtain the configuration

* feat: 增加元数据传输相关拦截器

* feat: 调整example打包脚本

* fix: 修复脚本没法跳转的问题

* fix: 修正样例的配置文件

* fix: 修复熔断无法加载的问题

* fix: 更新北极星的版本号依赖

* fix: 调整版本依赖

* feat:对齐deployment与application中的服务名定义
  • Loading branch information
andrewshan authored May 11, 2024
1 parent 4ab49d9 commit f7cb5ae
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public RestTemplate restTemplate() {
@RestController
public static class EchoController {

private Registration registration;
//private Registration registration;

private RestTemplate template;

Expand All @@ -63,7 +63,7 @@ public static class EchoController {
@Value("${spring.cloud.tencent.metadata.content.lane:base}")
private String lane;

public EchoController(RestTemplate restTemplate, Registration registration) {
public EchoController(RestTemplate restTemplate) {
this.template = restTemplate;
// this.registration = registration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public RestTemplate restTemplate() {
@RestController
public static class EchoController {

private Registration registration;

private RestTemplate restTemplate;

@Autowired
Expand All @@ -60,9 +58,8 @@ public static class EchoController {
@Value("${spring.cloud.tencent.metadata.content.lane:base}")
private String lane;

public EchoController(RestTemplate restTemplate, Registration registration) {
public EchoController(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
// this.registration = registration;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,9 @@ public RestTemplate restTemplate() {
@RestController
public static class EchoController {

private Registration registration;

@Value("${spring.cloud.tencent.metadata.content.lane:base}")
private String lane;

// public EchoController(Registration registration) {
// this.registration = registration;
// }


@GetMapping("/echo")
public String echo() {
return String.format("[%s]", lane);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hoxton-consumer
name: hoxton-consumer
app: service-consumer-hoxton
name: service-consumer-hoxton
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hoxton-consumer
app: service-consumer-hoxton
template:
metadata:
labels:
app: hoxton-consumer
app: service-consumer-hoxton
annotations:
polarismesh.cn/javaagent: "true"
polarismesh.cn/javaagentVersion: "1.7.0-RC2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public EchoController(RestTemplate restTemplate) {

@GetMapping("/echo/{str}")
public ResponseEntity<String> rest(@PathVariable String str) {
ResponseEntity<String> response = template.getForEntity("http://service-provider/echo/" + str,
ResponseEntity<String> response = template.getForEntity("http://service-provider-hoxton/echo/" + str,
String.class);
return response;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server.port=65002
spring.application.name=service-consumer-quickstart-hotxon
spring.application.name=service-consumer-hoxton
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.enabled=false
spring.cloud.nacos.config.enabled=false
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hoxton-provider
name: hoxton-provider
app: service-provider-hoxton
name: service-provider-hoxton
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hoxton-provider
app: service-provider-hoxton
template:
metadata:
labels:
app: hoxton-provider
app: service-provider-hoxton
annotations:
polarismesh.cn/javaagent: "true"
polarismesh.cn/javaagentVersion: "1.7.0-RC2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server.port=65001
spring.application.name=service-provider-quickstart-hotxon
spring.application.name=service-provider-hoxton
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.enabled=false
spring.cloud.nacos.config.enabled=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hoxton-scg
name: hoxton-scg
app: scg-gateway-hoxton
name: scg-gateway-hoxton
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hoxton-scg
app: scg-gateway-hoxton
template:
metadata:
labels:
app: hoxton-scg
app: scg-gateway-hoxton
annotations:
polarismesh.cn/javaagent: "true"
polarismesh.cn/javaagentVersion: "1.7.0-RC2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server.port=65000
spring.application.name=service-gateway-quickstart-hoxton
spring.application.name=scg-gateway-hoxton
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.enabled=false
spring.cloud.gateway.discovery.locator.enabled=true
Expand Down

0 comments on commit f7cb5ae

Please sign in to comment.