From 079ac0a16c3da707aa1fc24c59b63a3b3b3ea071 Mon Sep 17 00:00:00 2001
From: Haotian Zhang <928016560@qq.com>
Date: Thu, 14 Aug 2025 16:01:11 +0800
Subject: [PATCH] feat: support tsf gw.
---
.../tsf-example/msgw-scg/pom.xml | 32 +++++++++++++++++
.../cloud/tsf/msgw/scg/ScgApplication.java | 34 +++++++++++++++++++
.../msgw-scg/src/main/resources/bootstrap.yml | 28 +++++++++++++++
.../tsf-example/pom.xml | 1 +
4 files changed, 95 insertions(+)
create mode 100644 spring-cloud-tencent-examples/tsf-example/msgw-scg/pom.xml
create mode 100644 spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/java/com/tencent/cloud/tsf/msgw/scg/ScgApplication.java
create mode 100644 spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/resources/bootstrap.yml
diff --git a/spring-cloud-tencent-examples/tsf-example/msgw-scg/pom.xml b/spring-cloud-tencent-examples/tsf-example/msgw-scg/pom.xml
new file mode 100644
index 000000000..135d28ea2
--- /dev/null
+++ b/spring-cloud-tencent-examples/tsf-example/msgw-scg/pom.xml
@@ -0,0 +1,32 @@
+
+
+
+ tsf-example
+ com.tencent.cloud
+ ${revision}
+ ../pom.xml
+
+ 4.0.0
+
+ msgw-scg
+
+
+
+
+ com.tencent.cloud
+ spring-cloud-starter-tencent-all
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-gateway
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-bootstrap
+
+
+
\ No newline at end of file
diff --git a/spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/java/com/tencent/cloud/tsf/msgw/scg/ScgApplication.java b/spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/java/com/tencent/cloud/tsf/msgw/scg/ScgApplication.java
new file mode 100644
index 000000000..bdb9766d8
--- /dev/null
+++ b/spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/java/com/tencent/cloud/tsf/msgw/scg/ScgApplication.java
@@ -0,0 +1,34 @@
+/*
+ * Tencent is pleased to support the open source community by making spring-cloud-tencent available.
+ *
+ * Copyright (C) 2021 Tencent. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+package com.tencent.cloud.tsf.msgw.scg;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.tsf.annotation.EnableTsf;
+
+/**
+ * @author seanlxliu
+ */
+@SpringBootApplication
+@EnableTsf
+public class ScgApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(ScgApplication.class, args);
+ }
+}
diff --git a/spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/resources/bootstrap.yml
new file mode 100644
index 000000000..6f4b1c4c2
--- /dev/null
+++ b/spring-cloud-tencent-examples/tsf-example/msgw-scg/src/main/resources/bootstrap.yml
@@ -0,0 +1,28 @@
+server:
+ port: 8080
+ error:
+ include-exception: true
+spring:
+ application:
+ name: msgw-scg
+ cloud:
+ gateway:
+ discovery:
+ locator:
+ enabled: true
+ lower-case-service-id: false
+ httpclient:
+ # The connect timeout in millis, the default is 45s.
+ connectTimeout: 200
+ responseTimeout: 10s
+ consul:
+ enabled: true
+ scheme: HTTP
+
+logging:
+ level:
+ root: INFO
+ file:
+ name: /tsf-demo-logs/${spring.application.name}/root.log
+ pattern:
+ level: "%-5level [${spring.application.name},%mdc{trace_id},%mdc{span_id},]"
diff --git a/spring-cloud-tencent-examples/tsf-example/pom.xml b/spring-cloud-tencent-examples/tsf-example/pom.xml
index 979efb5f9..64bb8a42a 100644
--- a/spring-cloud-tencent-examples/tsf-example/pom.xml
+++ b/spring-cloud-tencent-examples/tsf-example/pom.xml
@@ -17,5 +17,6 @@
provider-demo
consumer-demo-retry
consumer-demo
+ msgw-scg