You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2020/11/16 01:55:45 UTC
[servicecomb-java-chassis] branch master updated:
[SCB-2117]dependency update: update vert.x from 3.8.3 to 3.9.4(perf used a
lot of deprecated API, move to servicecomb-samples) (#2056)
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 425ca53 [SCB-2117]dependency update: update vert.x from 3.8.3 to 3.9.4(perf used a lot of deprecated API, move to servicecomb-samples) (#2056)
425ca53 is described below
commit 425ca53c42656cd8dcf271e65140771d1fc50540
Author: bao liu <bi...@qq.com>
AuthorDate: Mon Nov 16 09:29:30 2020 +0800
[SCB-2117]dependency update: update vert.x from 3.8.3 to 3.9.4(perf used a lot of deprecated API, move to servicecomb-samples) (#2056)
---
.../codec/param/TestRestClientRequestImpl.java | 3 +-
.../demo/edge/consumer/ConsumerMain.java | 2 +
demo/perf/pom.xml | 83 -------------
demo/perf/readme.MD | 45 -------
.../org/apache/servicecomb/demo/perf/Code.java | 74 ------------
.../org/apache/servicecomb/demo/perf/Impl.java | 81 -------------
.../org/apache/servicecomb/demo/perf/Intf.java | 26 ----
.../servicecomb/demo/perf/PerfConfiguration.java | 133 ---------------------
.../apache/servicecomb/demo/perf/PerfConsumer.java | 101 ----------------
.../org/apache/servicecomb/demo/perf/PerfMain.java | 40 -------
.../servicecomb/demo/perf/RedisClientUtils.java | 74 ------------
.../apache/servicecomb/demo/perf/RedisSession.java | 71 -----------
demo/perf/src/main/resources/logback.xml | 29 -----
demo/perf/src/main/resources/microservice.yaml | 79 ------------
demo/pom.xml | 1 -
dependencies/default/pom.xml | 2 +-
.../config/client/ConfigCenterClient.java | 4 +-
.../main/java/io/vertx/core/impl/SyncContext.java | 2 +-
.../vertx/TestAddressResolverConfig.java | 32 ++---
.../client/http/RestClientUtil.java | 3 +-
.../client/http/WebsocketClientUtil.java | 3 +-
.../transport/highway/HighwayServerVerticle.java | 16 ++-
.../transport/highway/TestHighwayVerticle.java | 8 +-
.../client/http/TestDefaultHttpClientFilter.java | 9 +-
24 files changed, 42 insertions(+), 879 deletions(-)
diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/param/TestRestClientRequestImpl.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/param/TestRestClientRequestImpl.java
index 3e25612..0ae44b4 100644
--- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/param/TestRestClientRequestImpl.java
+++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/param/TestRestClientRequestImpl.java
@@ -34,7 +34,6 @@ import com.google.common.collect.Multimap;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
-import io.vertx.core.http.CaseInsensitiveHeaders;
import io.vertx.core.http.HttpClientRequest;
import mockit.Deencapsulation;
import mockit.Expectations;
@@ -60,7 +59,7 @@ public class TestRestClientRequestImpl {
public void testCookie() throws Exception {
HttpClientRequest request = new MockUp<HttpClientRequest>() {
- MultiMap map = new CaseInsensitiveHeaders();
+ MultiMap map = MultiMap.caseInsensitiveMultiMap();
@Mock
public HttpClientRequest putHeader(CharSequence key, CharSequence val) {
diff --git a/demo/demo-edge/consumer/src/main/java/org/apache/servicecomb/demo/edge/consumer/ConsumerMain.java b/demo/demo-edge/consumer/src/main/java/org/apache/servicecomb/demo/edge/consumer/ConsumerMain.java
index 1bcfc30..8feeaeb 100644
--- a/demo/demo-edge/consumer/src/main/java/org/apache/servicecomb/demo/edge/consumer/ConsumerMain.java
+++ b/demo/demo-edge/consumer/src/main/java/org/apache/servicecomb/demo/edge/consumer/ConsumerMain.java
@@ -17,6 +17,7 @@
package org.apache.servicecomb.demo.edge.consumer;
+import org.apache.servicecomb.demo.edge.model.ChannelRequestBase;
import org.apache.servicecomb.foundation.common.utils.BeanUtils;
import org.apache.servicecomb.foundation.common.utils.Log4jUtils;
@@ -26,6 +27,7 @@ public class ConsumerMain {
BeanUtils.init();
new Consumer().testEncrypt();
+ new Consumer().invokeBusiness("cse://business/business/v1", new ChannelRequestBase());
System.out.println("Running api dispatcher.");
new Consumer().run("api");
diff --git a/demo/perf/pom.xml b/demo/perf/pom.xml
deleted file mode 100644
index f3e92ad..0000000
--- a/demo/perf/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.servicecomb.demo</groupId>
- <artifactId>demo-parent</artifactId>
- <version>2.1.3-SNAPSHOT</version>
- </parent>
- <artifactId>perf</artifactId>
- <name>Java Chassis::Demo::Perf</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>registry-service-center</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>provider-pojo</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>provider-springmvc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>transport-rest-vertx</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>transport-highway</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>inspector</artifactId>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.vertx</groupId>
- <artifactId>vertx-redis-client</artifactId>
- <version>${vertx.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>metrics-core</artifactId>
- </dependency>
- </dependencies>
-
- <properties>
- <demo.main>org.apache.servicecomb.demo.perf.PerfMain</demo.main>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/demo/perf/readme.MD b/demo/perf/readme.MD
deleted file mode 100644
index 00062ab..0000000
--- a/demo/perf/readme.MD
+++ /dev/null
@@ -1,45 +0,0 @@
-suppose jar named perf.jar
-1.copy perf.jar to different directory
-
-2.create microservice.yaml in each directory
-# change microserviceName to be perf1/perf2/perf3, and so on
-service_description:
- name: perf1
-cse:
- references:
- # use which transport to invoke
- transport: rest
-
-# sync mode consumer count
-sync-count: 10
-# async mode consumer count
-async-count: 20
-# use sync mode or not
-# sync: /v1/syncQuery/{id}?step={step}&all={all}&fromDB={fromDB}
-# async:/v1/asyncQuery/{id}?step={step}&all={all}&fromDB={fromDB}
-sync: false
-# producer microserviceName
-producer: perf1
-id: 1
-# every producer determine:
-# 1)if step equals all, then this is final step, direct return or query from db
-# 2)otherwise inc step and invoke next microservice
-# 3)if self name if perf1, then next microservice is perf2
-step: 1
-all: 1
-fromDB: false
-response-size: 1
-
-# redis parameter
-redis:
- client:
- count: 8
- host:
- port:
- password:
-
-3.start producers
-java -jar perf.jar
-
-4.start consumer
-java -jar perf.jar -c
\ No newline at end of file
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Code.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Code.java
deleted file mode 100644
index 92a93c2..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Code.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-
-// git log --author="wujimin" --pretty=tformat:%s --shortstat --since ==2017-9-1
-public class Code {
- static File file = new File("d:/work/git/incubator-servicecomb-java-chassis/0218.txt");
-
- public static void main(String[] args) throws IOException {
- List<String> lines = FileUtils.readLines(file, StandardCharsets.UTF_8);
-
- int totalAdd = 0;
- int totalDel = 0;
- List<String> output = new ArrayList<>();
- System.out.println(lines.size());
- for (int idx = 0; idx < lines.size(); ) {
- String msg = lines.get(idx);
-
- // skip a empty line
- idx += 2;
- // 2 files changed, 2 insertions(+), 2 deletions(-)
- String line = lines.get(idx);
- idx++;
-// System.out.println(idx + ": " + msg);
-
- int add = 0;
- int delete = 0;
- for (String part : line.split(",")) {
- String key = " insertions(+)";
- int matchIdx = part.indexOf(key);
- if (matchIdx > 0) {
- add = Integer.valueOf(part.substring(0, matchIdx).trim());
- continue;
- }
-
- key = " deletions(-)";
- matchIdx = part.indexOf(key);
- if (matchIdx > 0) {
- delete = Integer.valueOf(part.substring(0, matchIdx).trim());
- continue;
- }
- }
-
- totalAdd += add;
- totalDel += delete;
- output.add(String.format("%d | %d | %s", add, delete, msg));
- }
-
- output.add(String.format("summary, add: %d, del: %s", totalAdd, totalDel));
- System.out.println(String.join("\n", output));
- }
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Impl.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Impl.java
deleted file mode 100644
index e2505ed..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Impl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.util.concurrent.CompletableFuture;
-
-import org.apache.servicecomb.provider.pojo.Invoker;
-import org.apache.servicecomb.provider.rest.common.RestSchema;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-@RestSchema(schemaId = "impl")
-@RequestMapping(path = "/v1")
-public class Impl {
- private Intf intf;
-
- @Value(value = "${service_description.name}")
- public void setSelfMicroserviceName(String selfMicroserviceName) {
- // self: perf-1/perf-a
- // next: perf-2/perf-b
- char last = selfMicroserviceName.charAt(selfMicroserviceName.length() - 1);
- String nextMicroserviceName =
- selfMicroserviceName.substring(0, selfMicroserviceName.length() - 1) + (char) (last + 1);
- intf = Invoker.createProxy(nextMicroserviceName,
- "impl",
- Intf.class);
- }
-
- @GetMapping(path = "/syncQuery/{id}")
- public String syncQuery(@PathVariable(name = "id") String id,
- @RequestParam(name = "step") int step, @RequestParam(name = "all") int all,
- @RequestParam(name = "fromDB") boolean fromDB) {
- if (step == all) {
- if (fromDB) {
- return RedisClientUtils.syncQuery(id);
- }
-
- return buildFromMemoryResponse(id);
- }
-
- return intf.syncQuery(id, step + 1, all, fromDB);
- }
-
- public String buildFromMemoryResponse(String id) {
- return PerfConfiguration.buildResponse("memory", id);
- }
-
- @GetMapping(path = "/asyncQuery/{id}")
- public CompletableFuture<String> asyncQuery(@PathVariable(name = "id") String id,
- @RequestParam(name = "step") int step, @RequestParam(name = "all") int all,
- @RequestParam(name = "fromDB") boolean fromDB) {
- if (step == all) {
- if (fromDB) {
- return RedisClientUtils.asyncQuery(id);
- }
-
- CompletableFuture<String> future = new CompletableFuture<>();
- future.complete(buildFromMemoryResponse(id));
- return future;
- }
-
- return intf.asyncQuery(id, step + 1, all, fromDB);
- }
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Intf.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Intf.java
deleted file mode 100644
index c671fda..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/Intf.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.util.concurrent.CompletableFuture;
-
-public interface Intf {
- String syncQuery(String id, int step, int all, boolean fromDB);
-
- CompletableFuture<String> asyncQuery(String id, int step, int all, boolean fromDB);
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfConfiguration.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfConfiguration.java
deleted file mode 100644
index 8d750b0..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfConfiguration.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import com.google.common.base.Strings;
-
-@Component
-public class PerfConfiguration {
- public static int syncCount;
-
- public static int asyncCount;
-
- public static boolean sync;
-
- public static String producer;
-
- public static String id;
-
- public static int step;
-
- public static int all;
-
- public static boolean fromDB;
-
- public static int responseSize;
-
- public static String responseData;
-
- public static int redisClientCount;
-
- public static String redisHost;
-
- public static int redisPort;
-
- public static String redisPassword;
-
- public static String buildResponse(String from, String id) {
- return new StringBuilder(64 + PerfConfiguration.responseData.length())
- .append(id)
- .append(" from ")
- .append(from)
- .append(": ")
- .append(PerfConfiguration.responseData)
- .toString();
- }
-
- @Value(value = "${response-size}")
- public void setResponseSize(int responseSize) {
- PerfConfiguration.responseSize = responseSize;
- PerfConfiguration.responseData = Strings.repeat("a", responseSize);
- }
-
- @Value(value = "${sync-count}")
- public void setSyncCount(int syncCount) {
- PerfConfiguration.syncCount = syncCount;
- }
-
- @Value(value = "${async-count}")
- public void setAsyncCount(int asyncCount) {
- PerfConfiguration.asyncCount = asyncCount;
- }
-
- @Value(value = "${sync}")
- public void setSync(boolean sync) {
- PerfConfiguration.sync = sync;
- }
-
- @Value(value = "${producer}")
- public void setProducer(String producer) {
- PerfConfiguration.producer = producer;
- }
-
- @Value(value = "${id}")
- public void setId(String id) {
- PerfConfiguration.id = id;
- }
-
- @Value(value = "${step}")
- public void setStep(int step) {
- PerfConfiguration.step = step;
- }
-
- @Value(value = "${all}")
- public void setAll(int all) {
- PerfConfiguration.all = all;
- }
-
- @Value(value = "${fromDB}")
- public void setFromDB(boolean fromDB) {
- PerfConfiguration.fromDB = fromDB;
- }
-
- @Value(value = "${redis.client.count}")
- public void setRedisClientCount(int redisClientCount) {
- PerfConfiguration.redisClientCount = redisClientCount;
- }
-
- @Value(value = "${redis.host}")
- public void setRedisHost(String redisHost) {
- PerfConfiguration.redisHost = redisHost;
- }
-
- @Value(value = "${redis.port}")
- public void setRedisPort(int redisPort) {
- PerfConfiguration.redisPort = redisPort;
- }
-
- @Value(value = "${redis.password:}")
- public void setRedisPassword(String redisPassword) {
- if (StringUtils.isEmpty(redisPassword)) {
- return;
- }
- PerfConfiguration.redisPassword = redisPassword;
- }
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfConsumer.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfConsumer.java
deleted file mode 100644
index a73b768..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfConsumer.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
-import org.apache.servicecomb.provider.pojo.Invoker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Component
-public class PerfConsumer {
- private static final Logger LOGGER = LoggerFactory.getLogger(PerfConsumer.class);
-
- private Intf intf;
-
- public void runConsumer() throws InterruptedException, ExecutionException {
- intf = Invoker.createProxy(
- PerfConfiguration.producer,
- "impl",
- Intf.class);
-
- if (PerfConfiguration.sync) {
- runSyncConsumers();
- return;
- }
-
- runAsyncConsumers();
- }
-
- private void runAsyncConsumers() throws InterruptedException, ExecutionException {
- CompletableFuture<String> future = intf.asyncQuery(PerfConfiguration.id,
- PerfConfiguration.step,
- PerfConfiguration.all,
- PerfConfiguration.fromDB);
- LOGGER.info("runAsyncConsumer: {}", future.get());
-
- for (int idx = 0; idx < PerfConfiguration.asyncCount; idx++) {
- runAsyncConsumer();
- }
- }
-
- private void runAsyncConsumer() {
- CompletableFuture<String> future = intf.asyncQuery(PerfConfiguration.id,
- PerfConfiguration.step,
- PerfConfiguration.all,
- PerfConfiguration.fromDB);
- future.whenComplete((r, e) -> {
- if (e == null) {
- runAsyncConsumer();
- return;
- }
-
- throw new IllegalStateException("invoke failed.", e);
- });
- }
-
- private void runSyncConsumers() {
- LOGGER.info("runSyncConsumer: {}",
- intf.syncQuery(PerfConfiguration.id,
- PerfConfiguration.step,
- PerfConfiguration.all,
- PerfConfiguration.fromDB));
-
- Executor executor = Executors.newFixedThreadPool(PerfConfiguration.syncCount);
- for (int idx = 0; idx < PerfConfiguration.syncCount; idx++) {
- executor.execute(this::runSyncConsumer);
- }
- }
-
- private void runSyncConsumer() {
- try {
- for (; ; ) {
- intf.syncQuery(PerfConfiguration.id,
- PerfConfiguration.step,
- PerfConfiguration.all,
- PerfConfiguration.fromDB);
- }
- } catch (Throwable e) {
- throw new IllegalStateException("invoke failed.", e);
- }
- }
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfMain.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfMain.java
deleted file mode 100644
index 871ccb4..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/PerfMain.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.servicecomb.foundation.common.utils.BeanUtils;
-import org.apache.servicecomb.foundation.vertx.VertxUtils;
-
-public class PerfMain {
-
- public static void main(String[] args) throws Exception {
- BeanUtils.init();
-
- // redis
- RedisClientUtils.init(VertxUtils.getOrCreateVertxByName("transport", null));
-
- List<String> argList = Arrays.asList(args);
- if (argList.contains("-c")) {
- PerfConsumer consumer = BeanUtils.getContext().getBean(PerfConsumer.class);
- consumer.runConsumer();
- }
- }
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/RedisClientUtils.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/RedisClientUtils.java
deleted file mode 100644
index 0ce693a..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/RedisClientUtils.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.apache.servicecomb.foundation.vertx.VertxUtils;
-import org.apache.servicecomb.foundation.vertx.client.ClientPoolFactory;
-import org.apache.servicecomb.foundation.vertx.client.ClientPoolManager;
-import org.apache.servicecomb.foundation.vertx.client.ClientVerticle;
-import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
-
-import io.vertx.core.DeploymentOptions;
-import io.vertx.core.Vertx;
-import io.vertx.redis.RedisClient;
-import io.vertx.redis.RedisOptions;
-
-public class RedisClientUtils {
- private static ClientPoolManager<RedisClient> clientMgr;
-
- public static void init(Vertx vertx) throws InterruptedException {
- RedisOptions redisOptions = new RedisOptions()
- .setHost(PerfConfiguration.redisHost)
- .setPort(PerfConfiguration.redisPort)
- .setAuth(PerfConfiguration.redisPassword);
- ClientPoolFactory<RedisClient> factory = (ctx) -> {
- return RedisClient.create(vertx, redisOptions);
- };
- clientMgr = new ClientPoolManager<>(vertx, factory);
-
- DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(clientMgr,
- PerfConfiguration.redisClientCount);
- VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
- }
-
- public static String syncQuery(String id) {
- CompletableFuture<String> future = doQuery(id, true);
- try {
- return future.get();
- } catch (InterruptedException | ExecutionException e) {
- throw new InvocationException(Status.INTERNAL_SERVER_ERROR.getStatusCode(),
- Status.INTERNAL_SERVER_ERROR.getReasonPhrase(), (Object) "Failed to query from redis.", e);
- }
- }
-
- public static CompletableFuture<String> asyncQuery(String id) {
- return doQuery(id, false);
- }
-
- private static CompletableFuture<String> doQuery(String id, boolean sync) {
- CompletableFuture<String> future = new CompletableFuture<>();
- RedisClient redisClient = clientMgr.findClientPool(sync);
- RedisSession session = new RedisSession(redisClient, id, future);
- session.query();
- return future;
- }
-}
diff --git a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/RedisSession.java b/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/RedisSession.java
deleted file mode 100644
index f9d657f..0000000
--- a/demo/perf/src/main/java/org/apache/servicecomb/demo/perf/RedisSession.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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 org.apache.servicecomb.demo.perf;
-
-import java.util.concurrent.CompletableFuture;
-
-import io.vertx.core.AsyncResult;
-import io.vertx.redis.RedisClient;
-
-public class RedisSession {
- RedisClient redis;
-
- String id;
-
- CompletableFuture<String> future;
-
- String createResult;
-
- public RedisSession(RedisClient redis, String id, CompletableFuture<String> future) {
- this.redis = redis;
- this.id = id;
- this.future = future;
- }
-
- public void query() {
- redis.get(id, this::onGetResponse);
- }
-
- private void onGetResponse(AsyncResult<String> ar) {
- if (ar.succeeded()) {
- if (ar.result() == null) {
- createCache();
- return;
- }
-
- future.complete(ar.result());
- return;
- }
-
- future.completeExceptionally(ar.cause());
- }
-
- private void createCache() {
- createResult = PerfConfiguration.buildResponse("redis", id);
- redis.set(id, createResult, this::onCreateCacheResponse);
- }
-
- private void onCreateCacheResponse(AsyncResult<Void> ar) {
- if (ar.succeeded()) {
- future.complete(createResult);
- return;
- }
-
- future.completeExceptionally(ar.cause());
- }
-}
diff --git a/demo/perf/src/main/resources/logback.xml b/demo/perf/src/main/resources/logback.xml
deleted file mode 100644
index 5264742..0000000
--- a/demo/perf/src/main/resources/logback.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<configuration scan="true">
- <jmxConfigurator/>
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d[%level][%thread][%marker] - %msg (%F:%L\)%n</pattern>
- </encoder>
- </appender>
- <root level="INFO">
- <appender-ref ref="STDOUT"/>
- </root>
-</configuration>
\ No newline at end of file
diff --git a/demo/perf/src/main/resources/microservice.yaml b/demo/perf/src/main/resources/microservice.yaml
deleted file mode 100644
index 4a26c08..0000000
--- a/demo/perf/src/main/resources/microservice.yaml
+++ /dev/null
@@ -1,79 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-APPLICATION_ID: perfTest
-service_description:
- name: perf1
- version: 0.0.1
-servicecomb:
- service:
- registry:
- address: http://127.0.0.1:30100
- rest:
- address: 0.0.0.0:8080?sslEnabled=false
- server:
- verticle-count: 8
- client:
- verticle-count: 8
- connection:
- maxPoolSize: 30
- highway:
- address: 0.0.0.0:7070?sslEnabled=false
- server:
- verticle-count: 8
- client:
- verticle-count: 8
- executor:
- default:
- group: 4
- maxThreads-per-group: 4
- references:
- transport: highway
- transport: rest
- metrics:
- endpoint:
- enabled: false
- window_time: 1000
- invocation.latencyDistribution: 0,1,3,10,100
- Consumer.invocation.slow:
- enabled: true
- msTime: 40
- Provider.invocation.slow:
- enabled: true
- msTime: 1
- publisher.defaultLog:
- enabled: true
- endpoints.client.detail.enabled: true
- invocation.latencyDistribution:
- minScopeLength: 9
-
-sync-count: 10
-async-count: 10
-sync: false
-producer: perf1
-id: 1
-step: 1
-all: 1
-fromDB: false
-response-size: 1
-
-redis:
- client:
- count: 8
- host: localhost
- port: 6379
-# password:
diff --git a/demo/pom.xml b/demo/pom.xml
index 15fcaf7..ae13022 100644
--- a/demo/pom.xml
+++ b/demo/pom.xml
@@ -50,7 +50,6 @@
<module>demo-multiple</module>
<module>demo-multi-service-center</module>
<module>demo-signature</module>
- <module>perf</module>
</modules>
<dependencyManagement>
diff --git a/dependencies/default/pom.xml b/dependencies/default/pom.xml
index 7fdb72a..bc59696 100644
--- a/dependencies/default/pom.xml
+++ b/dependencies/default/pom.xml
@@ -107,7 +107,7 @@
<tcnetty.version>2.0.31.Final</tcnetty.version>
<tec-zkclient.version>0.10</tec-zkclient.version>
<tomakehurst.version>2.6.0</tomakehurst.version>
- <vertx.version>3.8.5</vertx.version>
+ <vertx.version>3.9.4</vertx.version>
<xstream.version>1.4.11.1</xstream.version>
<zipkin.version>2.19.1</zipkin.version>
<zipkin-reporter.version>2.7.13</zipkin-reporter.version>
diff --git a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index bdf02a2..6a40c85 100644
--- a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -52,8 +52,8 @@ import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.type.TypeReference;
import io.netty.handler.codec.http.HttpResponseStatus;
+import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
-import io.vertx.core.http.CaseInsensitiveHeaders;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.WebSocket;
import io.vertx.core.http.WebSocketConnectOptions;
@@ -216,7 +216,7 @@ public class ConfigCenterClient {
createSignRequest(null, configCenter + url, headers, null))));
WebSocketConnectOptions options = new WebSocketConnectOptions();
options.setHost(ipPort.getHostOrIp()).setPort(refreshPort).setURI(url)
- .setHeaders(new CaseInsensitiveHeaders().addAll(headers)
+ .setHeaders(MultiMap.caseInsensitiveMultiMap().addAll(headers)
.addAll(authHeaders));
client.webSocket(options, asyncResult -> {
if (asyncResult.failed()) {
diff --git a/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java b/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
index 0640b48..0d9d798 100644
--- a/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
+++ b/foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/SyncContext.java
@@ -59,7 +59,7 @@ public class SyncContext extends EventLoopContext {
return;
}
- res.future().setHandler(asyncResultHandler);
+ res.future().onComplete(asyncResultHandler);
}
@Override
diff --git a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestAddressResolverConfig.java b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestAddressResolverConfig.java
index da4bc2c..2cf4bb8 100644
--- a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestAddressResolverConfig.java
+++ b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/TestAddressResolverConfig.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.foundation.vertx;
import static org.hamcrest.CoreMatchers.is;
import java.util.Arrays;
+import java.util.Collections;
import org.apache.commons.configuration.Configuration;
import org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils;
@@ -45,7 +46,7 @@ public class TestAddressResolverConfig {
}
@Test
- public void testGetResoverFromResource(@Mocked Configuration finalConfig) {
+ public void testGetResolverFromResource(@Mocked Configuration finalConfig) {
ArchaiusUtils.resetConfig();
ArchaiusUtils.setProperty("addressResolver.servers", "8.8.8.8,8.8.4.4");
new Expectations() {
@@ -60,18 +61,18 @@ public class TestAddressResolverConfig {
result = -2;
}
};
- AddressResolverOptions aroc = AddressResolverConfig.getAddressResover("test", finalConfig);
- Assert.assertThat(aroc.getServers(), is(Arrays.asList("6.6.6.6", "6.6.4.4")));
- Assert.assertThat(aroc.getSearchDomains(),
- is(Arrays.asList("default.svc.local.cluster")));
- Assert.assertEquals(aroc.getQueryTimeout(),
+ AddressResolverOptions resolverOptions = AddressResolverConfig.getAddressResover("test", finalConfig);
+ Assert.assertThat(resolverOptions.getServers(), is(Arrays.asList("6.6.6.6", "6.6.4.4")));
+ Assert.assertThat(resolverOptions.getSearchDomains(),
+ is(Collections.singletonList("default.svc.local.cluster")));
+ Assert.assertEquals(resolverOptions.getQueryTimeout(),
2000);
- Assert.assertNotEquals(aroc.getMaxQueries(),
+ Assert.assertNotEquals(resolverOptions.getMaxQueries(),
-2);
}
@Test
- public void testGetResover() {
+ public void testGetResolver() {
ArchaiusUtils.resetConfig();
ArchaiusUtils.setProperty("addressResolver.servers", "8.8.8.8,8.8.4.4");
ArchaiusUtils.setProperty("addressResolver.optResourceEnabled", true);
@@ -95,19 +96,20 @@ public class TestAddressResolverConfig {
AddressResolverOptions aroc1 = AddressResolverConfig.getAddressResover("test1");
Assert.assertThat(aroc1.getSearchDomains(),
is(Arrays.asList("default.svc.local.cluster", "svc.local.cluster", "local.cluster")));
+ Assert.assertTrue(aroc.isOptResourceEnabled());
}
@Test
- public void testGetResoverDefault() {
+ public void testGetResolverDefault() {
ArchaiusUtils.resetConfig();
ArchaiusUtils.setProperty("addressResolver.servers", "8.8.8.8,8.8.4.4");
ArchaiusUtils.setProperty("addressResolver.maxQueries", 3);
ArchaiusUtils.setProperty("addressResolver.rdFlag", false);
- AddressResolverOptions aroc = AddressResolverConfig.getAddressResover("test");
- Assert.assertThat(aroc.getServers(), is(Arrays.asList("8.8.8.8", "8.8.4.4")));
- Assert.assertEquals(3, aroc.getMaxQueries());
- Assert.assertEquals(Integer.MAX_VALUE, aroc.getCacheMaxTimeToLive());
- Assert.assertTrue(aroc.isOptResourceEnabled());
- Assert.assertNull(aroc.getSearchDomains());
+ AddressResolverOptions resolverOptions = AddressResolverConfig.getAddressResover("test");
+ Assert.assertThat(resolverOptions.getServers(), is(Arrays.asList("8.8.8.8", "8.8.4.4")));
+ Assert.assertEquals(3, resolverOptions.getMaxQueries());
+ Assert.assertEquals(Integer.MAX_VALUE, resolverOptions.getCacheMaxTimeToLive());
+ Assert.assertFalse(resolverOptions.isOptResourceEnabled());
+ Assert.assertNull(resolverOptions.getSearchDomains());
}
}
diff --git a/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java b/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
index 57f4a86..cf9e119 100644
--- a/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
+++ b/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/RestClientUtil.java
@@ -36,7 +36,6 @@ import org.slf4j.LoggerFactory;
import io.vertx.core.Handler;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
-import io.vertx.core.http.CaseInsensitiveHeaders;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpMethod;
@@ -199,7 +198,7 @@ final class RestClientUtil {
}
public MultiMap getDefaultHeaders() {
- return new CaseInsensitiveHeaders().addAll(defaultHeaders());
+ return MultiMap.caseInsensitiveMultiMap().addAll(defaultHeaders());
}
public void get(IpPort ipPort, String uri, RequestParam requestParam,
diff --git a/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java b/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java
index 1ab17e7..cb9aef5 100644
--- a/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java
+++ b/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/client/http/WebsocketClientUtil.java
@@ -35,7 +35,6 @@ import org.slf4j.LoggerFactory;
import io.vertx.core.Handler;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
-import io.vertx.core.http.CaseInsensitiveHeaders;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.WebSocketConnectOptions;
@@ -86,7 +85,7 @@ public final class WebsocketClientUtil {
}
public MultiMap getDefaultHeaders() {
- return new CaseInsensitiveHeaders().addAll(defaultHeaders());
+ return MultiMap.caseInsensitiveMultiMap().addAll(defaultHeaders());
}
private Map<String, String> defaultHeaders() {
diff --git a/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerVerticle.java b/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerVerticle.java
index 8104ecc..b4c3c31 100644
--- a/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerVerticle.java
+++ b/transports/transport-highway/src/main/java/org/apache/servicecomb/transport/highway/HighwayServerVerticle.java
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Context;
-import io.vertx.core.Future;
+import io.vertx.core.Promise;
import io.vertx.core.Vertx;
public class HighwayServerVerticle extends AbstractVerticle {
@@ -48,10 +48,10 @@ public class HighwayServerVerticle extends AbstractVerticle {
}
@Override
- public void start(Future<Void> startFuture) throws Exception {
+ public void start(Promise<Void> startPromise) throws Exception {
try {
super.start();
- startListen(startFuture);
+ startListen(startPromise);
} catch (Throwable e) {
// vert.x got some states that not print error and execute call back in VertexUtils.blockDeploy, we add a log our self.
LOGGER.error("", e);
@@ -59,13 +59,11 @@ public class HighwayServerVerticle extends AbstractVerticle {
}
}
- @SuppressWarnings("deprecation")
- // TODO: vert.x 3.8.3 does not update startListen to promise, so we keep use deprecated API now. update in newer version.
- protected void startListen(Future<Void> startFuture) {
+ protected void startListen(Promise<Void> startPromise) {
// if listen address is not provided, do not fail and maybe a consumer service.
if (endpointObject == null) {
LOGGER.warn("highway listen address is not configured, will not listen.");
- startFuture.complete();
+ startPromise.complete();
return;
}
@@ -76,12 +74,12 @@ public class HighwayServerVerticle extends AbstractVerticle {
LOGGER.info("highway listen success. address={}:{}",
socketAddress.getHostString(),
socketAddress.getPort());
- startFuture.complete();
+ startPromise.complete();
return;
}
LOGGER.error(Const.HIGHWAY, ar.cause());
- startFuture.fail(ar.cause());
+ startPromise.fail(ar.cause());
});
}
}
diff --git a/transports/transport-highway/src/test/java/org/apache/servicecomb/transport/highway/TestHighwayVerticle.java b/transports/transport-highway/src/test/java/org/apache/servicecomb/transport/highway/TestHighwayVerticle.java
index f2ac8d6..6c7ff66 100644
--- a/transports/transport-highway/src/test/java/org/apache/servicecomb/transport/highway/TestHighwayVerticle.java
+++ b/transports/transport-highway/src/test/java/org/apache/servicecomb/transport/highway/TestHighwayVerticle.java
@@ -28,7 +28,7 @@ import org.junit.Test;
import org.mockito.Mockito;
import io.vertx.core.Context;
-import io.vertx.core.Future;
+import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import mockit.Expectations;
@@ -60,11 +60,11 @@ public class TestHighwayVerticle {
highwayVerticle.init(vertx, context);
@SuppressWarnings("unchecked")
- Future<Void> startFuture = Mockito.mock(Future.class);
- highwayVerticle.startListen(startFuture);
+ Promise<Void> startPromise = Mockito.mock(Promise.class);
+ highwayVerticle.startListen(startPromise);
MockUtil.getInstance().mockHighwayConfig();
try {
- highwayVerticle.startListen(startFuture);
+ highwayVerticle.startListen(startPromise);
assertTrue(true);
} catch (Exception e) {
Assert.fail();
diff --git a/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/http/TestDefaultHttpClientFilter.java b/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/http/TestDefaultHttpClientFilter.java
index b666977..e04db0c 100644
--- a/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/http/TestDefaultHttpClientFilter.java
+++ b/transports/transport-rest/transport-rest-client/src/test/java/org/apache/servicecomb/transport/rest/client/http/TestDefaultHttpClientFilter.java
@@ -46,7 +46,6 @@ import com.fasterxml.jackson.databind.type.SimpleType;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.buffer.impl.BufferImpl;
-import io.vertx.core.http.CaseInsensitiveHeaders;
import mockit.Expectations;
import mockit.Mock;
import mockit.MockUp;
@@ -158,7 +157,8 @@ public class TestDefaultHttpClientFilter {
Assert.assertEquals(
"InvocationException: code=400;msg=CommonExceptionData [message=method null, path null, statusCode 400, reasonPhrase null, response content-type null is not supported]",
invocationException.getMessage());
- Assert.assertEquals("Unrecognized token 'abc': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n"
+ Assert.assertEquals(
+ "Unrecognized token 'abc': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n"
+ " at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 1, column: 4]",
invocationException.getCause().getMessage());
Assert.assertEquals(CommonExceptionData.class, invocationException.getErrorData().getClass());
@@ -204,7 +204,8 @@ public class TestDefaultHttpClientFilter {
Assert.assertEquals(
"InvocationException: code=400;msg=CommonExceptionData [message=method null, path null, statusCode 200, reasonPhrase null, response content-type null is not supported]",
invocationException.getMessage());
- Assert.assertEquals("Unrecognized token 'abc': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n"
+ Assert.assertEquals(
+ "Unrecognized token 'abc': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n"
+ " at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 1, column: 4]",
invocationException.getCause().getMessage());
Assert.assertEquals(CommonExceptionData.class, invocationException.getErrorData().getClass());
@@ -257,7 +258,7 @@ public class TestDefaultHttpClientFilter {
@Mocked OperationMeta operationMeta,
@Mocked RestOperationMeta swaggerRestOperation,
@Mocked ProduceProcessor produceProcessor) throws Exception {
- MultiMap responseHeader = new CaseInsensitiveHeaders();
+ MultiMap responseHeader = MultiMap.caseInsensitiveMultiMap();
responseHeader.add("b", "bValue");
Object decodedResult = new Object();