This is an automated email from the ASF dual-hosted git repository.

xingfudeshi pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 4006df1dcd optimize: compatible with integration.http and 
integration.http.Jakarta (#6327)
4006df1dcd is described below

commit 4006df1dcd12734cd228547777bf190cd5fe2659
Author: jimin <[email protected]>
AuthorDate: Thu Feb 15 13:05:53 2024 +0800

    optimize: compatible with integration.http and integration.http.Jakarta 
(#6327)
---
 changes/en-us/2.x.md                               |  1 +
 changes/zh-cn/2.x.md                               |  2 +-
 compatible/pom.xml                                 | 21 +++++++
 .../integration/http/DefaultHttpExecutor.java      | 64 ++++++++++++++++++++++
 .../http/JakartaSeataWebMvcConfigurer.java         | 19 +++++++
 .../JakartaTransactionPropagationInterceptor.java  | 19 +++++++
 .../integration/http/SeataWebMvcConfigurer.java    | 19 +++++++
 .../http/TransactionPropagationInterceptor.java    | 22 ++++++++
 8 files changed, 166 insertions(+), 1 deletion(-)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 84ac79f003..33030d937d 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -82,6 +82,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#6301](https://github.com/apache/incubator-seata/pull/6301)] upgrade 
console frontend dependencies and supported nodejs versions
 - [[#6301](https://github.com/apache/incubator-seata/pull/6312)] add saga 
related io.seata compatible api
 - [[#6313](https://github.com/apache/incubator-seata/pull/6313)] console 
display the version number
+- [[#6327](https://github.com/apache/incubator-seata/pull/6327)] compatible 
with integration.http and integration.http.Jakarta
 - [[#6328](https://github.com/apache/incubator-seata/pull/6328)] compatible 
with integration.grpc
 - [[#6330](https://github.com/apache/incubator-seata/pull/6330)] remove 
mariadb API
 - [[#6329](https://github.com/apache/incubator-seata/pull/6312)] add saga 
subcomponent-level io.seata compatible api
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index a21c548ee2..bd974324e6 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -80,6 +80,7 @@
 - [[#6301](https://github.com/apache/incubator-seata/pull/6301)] 
升级console前端依赖及支持的nodejs版本
 - [[#6301](https://github.com/apache/incubator-seata/pull/6312)] 
添加saga相关的io.seata兼容性API
 - [[#6313](https://github.com/apache/incubator-seata/pull/6313)] console展示版本号
+- [[#6327](https://github.com/apache/incubator-seata/pull/6327)] 兼容 
integration.http 和 integration.http.Jakarta API
 - [[#6328](https://github.com/apache/incubator-seata/pull/6328)] 兼容 
integration.grpc API
 - [[#6330](https://github.com/apache/incubator-seata/pull/6330)] 去除 mariadb API
 - [[#6329](https://github.com/apache/incubator-seata/pull/6312)] 
添加saga子组件的io.seata兼容性API
@@ -87,7 +88,6 @@
 - [[#6343](https://github.com/apache/incubator-seata/pull/6343)] 兼容tm 
模块和rm-datasource模块
 
 
-
 ### security:
 - [[#6069](https://github.com/apache/incubator-seata/pull/6069)] 
升级Guava依赖版本,修复安全漏洞
 - [[#6144](https://github.com/apache/incubator-seata/pull/6144)] 
升级Nacos依赖版本至1.4.6
diff --git a/compatible/pom.xml b/compatible/pom.xml
index 406d3e01d9..865aa264f8 100644
--- a/compatible/pom.xml
+++ b/compatible/pom.xml
@@ -49,6 +49,27 @@
             <version>2.1.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.seata</groupId>
+            <artifactId>seata-http</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.seata</groupId>
+            <artifactId>seata-http-jakarta</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.13</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+            <version>5.3.20</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.seata</groupId>
             <artifactId>seata-grpc</artifactId>
diff --git 
a/compatible/src/main/java/io/seata/integration/http/DefaultHttpExecutor.java 
b/compatible/src/main/java/io/seata/integration/http/DefaultHttpExecutor.java
new file mode 100644
index 0000000000..c3fd8d7d58
--- /dev/null
+++ 
b/compatible/src/main/java/io/seata/integration/http/DefaultHttpExecutor.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 io.seata.integration.http;
+
+import java.util.Map;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+
+public class DefaultHttpExecutor {
+
+    private static final org.apache.seata.integration.http.DefaultHttpExecutor 
INSTANCE
+        = org.apache.seata.integration.http.DefaultHttpExecutor.getInstance();
+
+    private final org.apache.seata.integration.http.DefaultHttpExecutor 
targetDefaultHttpExecutor;
+
+    private DefaultHttpExecutor(final 
org.apache.seata.integration.http.DefaultHttpExecutor innerInstance) {
+        this.targetDefaultHttpExecutor = innerInstance;
+    }
+
+    public static DefaultHttpExecutor getInstance() {
+        return new DefaultHttpExecutor(INSTANCE);
+    }
+
+    public <T> void buildClientEntity(CloseableHttpClient httpClient, T 
paramObject) {
+        this.targetDefaultHttpExecutor.buildClientEntity(httpClient, 
paramObject);
+    }
+
+    public <T> void buildGetHeaders(Map<String, String> headers, T 
paramObject) {
+        this.targetDefaultHttpExecutor.buildGetHeaders(headers, paramObject);
+    }
+
+    public String initGetUrl(String host, String path, Map<String, String> 
querys) {
+        return this.targetDefaultHttpExecutor.initGetUrl(host, path, querys);
+    }
+
+    public <T> void buildPostHeaders(Map<String, String> headers, T t) {
+        this.targetDefaultHttpExecutor.buildPostHeaders(headers, t);
+    }
+
+    public <T> StringEntity buildEntity(StringEntity entity, T t) {
+        return this.targetDefaultHttpExecutor.buildEntity(entity, t);
+    }
+
+    public <K> K convertResult(HttpResponse response, Class<K> clazz) {
+        return this.targetDefaultHttpExecutor.convertResult(response, clazz);
+    }
+
+}
diff --git 
a/compatible/src/main/java/io/seata/integration/http/JakartaSeataWebMvcConfigurer.java
 
b/compatible/src/main/java/io/seata/integration/http/JakartaSeataWebMvcConfigurer.java
new file mode 100644
index 0000000000..888819cc63
--- /dev/null
+++ 
b/compatible/src/main/java/io/seata/integration/http/JakartaSeataWebMvcConfigurer.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 io.seata.integration.http;
+
+public class JakartaSeataWebMvcConfigurer extends 
org.apache.seata.integration.http.JakartaSeataWebMvcConfigurer{}
\ No newline at end of file
diff --git 
a/compatible/src/main/java/io/seata/integration/http/JakartaTransactionPropagationInterceptor.java
 
b/compatible/src/main/java/io/seata/integration/http/JakartaTransactionPropagationInterceptor.java
new file mode 100644
index 0000000000..468f4dd539
--- /dev/null
+++ 
b/compatible/src/main/java/io/seata/integration/http/JakartaTransactionPropagationInterceptor.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 io.seata.integration.http;
+
+public class JakartaTransactionPropagationInterceptor extends 
org.apache.seata.integration.http.JakartaTransactionPropagationInterceptor{}
diff --git 
a/compatible/src/main/java/io/seata/integration/http/SeataWebMvcConfigurer.java 
b/compatible/src/main/java/io/seata/integration/http/SeataWebMvcConfigurer.java
new file mode 100644
index 0000000000..160f1873fe
--- /dev/null
+++ 
b/compatible/src/main/java/io/seata/integration/http/SeataWebMvcConfigurer.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 io.seata.integration.http;
+
+public class SeataWebMvcConfigurer extends 
org.apache.seata.integration.http.SeataWebMvcConfigurer {}
diff --git 
a/compatible/src/main/java/io/seata/integration/http/TransactionPropagationInterceptor.java
 
b/compatible/src/main/java/io/seata/integration/http/TransactionPropagationInterceptor.java
new file mode 100644
index 0000000000..7fd5f6e84a
--- /dev/null
+++ 
b/compatible/src/main/java/io/seata/integration/http/TransactionPropagationInterceptor.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 io.seata.integration.http;
+
+public class TransactionPropagationInterceptor
+    extends 
org.apache.seata.integration.http.TransactionPropagationInterceptor {
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to