Skip to content

Commit 008b455

Browse files
authored
[ISSUE #903] [Rust] Fix sync settings show an error after the connection is closed by the server side (#1025)
1 parent 40f5d5e commit 008b455

File tree

15 files changed

+1144
-103
lines changed

15 files changed

+1144
-103
lines changed

.github/workflows/java_coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
paths: "**/TEST-*.xml"
2727
if: always()
2828
- name: Upload to Codecov
29-
uses: codecov/codecov-action@v3
29+
uses: codecov/codecov-action@v4
3030
with:
3131
flags: java
3232
fail_ci_if_error: true
33-
token: e7eb01be-398b-4f7f-a73e-dc35c428cb50
33+
token: ${{ secrets.CODECOV_ACTION_KEY }}
3434
verbose: true

.github/workflows/rust_build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_call:
44
jobs:
55
fmt:
6-
name: code style check
6+
name: Code style check
77
runs-on: ubuntu-latest
88
defaults:
99
run:
@@ -20,7 +20,7 @@ jobs:
2020
- name: Code format check
2121
run: cargo fmt --check
2222
clippy:
23-
name: clippy
23+
name: Clippy
2424
runs-on: ubuntu-latest
2525
defaults:
2626
run:
@@ -35,10 +35,10 @@ jobs:
3535
toolchain: stable
3636
components: clippy
3737
# Run clippy
38-
- name: clippy check
38+
- name: Clippy check
3939
run: cargo clippy --all-features -- -D warnings
4040
doc:
41-
name: doc check
41+
name: Doc check
4242
runs-on: ubuntu-latest
4343
defaults:
4444
run:
@@ -62,7 +62,7 @@ jobs:
6262
working-directory: ./rust
6363
strategy:
6464
matrix:
65-
msrv: [1.70.0]
65+
msrv: [1.74.0]
6666
name: MSRV ${{ matrix.msrv }} check
6767
steps:
6868
- uses: actions/checkout@v3
@@ -71,7 +71,7 @@ jobs:
7171
- name: Install cargo-msrv
7272
run: |
7373
cargo install cargo-msrv
74-
cargo msrv --min ${{ matrix.msrv }}
74+
cargo msrv verify --min ${{ matrix.msrv }}
7575
build:
7676
name: "${{ matrix.os }}"
7777
runs-on: ${{ matrix.os }}
@@ -82,8 +82,8 @@ jobs:
8282
strategy:
8383
fail-fast: false
8484
matrix:
85-
os: [ubuntu-20.04, macos-12, windows-2022]
86-
msrv: [1.70]
85+
os: [Ubuntu-22.04, MacOS-15, Windows-2022]
86+
msrv: [1.74]
8787
steps:
8888
- uses: actions/checkout@v2
8989
with:
@@ -93,9 +93,9 @@ jobs:
9393
toolchain: ${{ matrix.msrv }}
9494
components: clippy
9595
- name: Install protoc
96-
uses: arduino/setup-protoc@v1
96+
uses: arduino/setup-protoc@v3
9797
with:
98-
version: "3.x"
98+
version: "29.x"
9999
repo-token: ${{ secrets.GITHUB_TOKEN }}
100100
- name: Build
101101
env:

.github/workflows/rust_coverage.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ jobs:
3333
run: cargo llvm-cov --all-features --workspace --ignore-filename-regex pb/ --codecov --output-path codecov.json
3434

3535
- name: Upload to codecov.io
36-
uses: codecov/codecov-action@v3
36+
uses: codecov/codecov-action@v4
3737
with:
3838
files: ./rust/codecov.json
3939
flags: rust
4040
verbose: true
41+
token: ${{ secrets.CODECOV_ACTION_KEY }}
4142
fail_ci_if_error: true

protos

rust/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
name = "rocketmq"
1919
version = "5.0.0"
2020
edition = "2021"
21-
rust-version = "1.70"
21+
rust-version = "1.74"
2222
authors = [
2323
"SSpirits <admin@lv5.moe>",
2424
"Zhanhui Li <lizhanhui@gmail.com>",
@@ -69,8 +69,8 @@ ring = "0.16.20"
6969
tokio-util = { version = "=0.7.10", features = ["rt"] }
7070

7171
[build-dependencies]
72-
tonic-build = "0.9.0"
73-
which = "4.4.0"
72+
tonic-build = "0.10.2"
73+
which = "7.0.3"
7474
version_check = "0.9.4"
7575
regex = "1.7.3"
7676

rust/build.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ fn main() {
3535
.out_dir("src/pb")
3636
.compile(
3737
&[
38-
"../protos/apache/rocketmq/v2/service.proto",
39-
"../protos/apache/rocketmq/v2/admin.proto",
38+
"./proto/apache/rocketmq/v2/service.proto",
39+
"./proto/apache/rocketmq/v2/admin.proto",
40+
"./proto/apache/rocketmq/v2/definition.proto",
4041
],
41-
&["../protos"],
42+
&["./proto"],
4243
)
43-
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
44+
.unwrap_or_else(|e| panic!("Failed to compile proto {e:?}"));
4445
}
4546

4647
fn check_protoc_version() {
@@ -57,12 +58,12 @@ fn check_protoc_version() {
5758
let result = cmd.output();
5859

5960
if result.is_err() {
60-
panic!("failed to invoke protoc: {:?}", result)
61+
panic!("failed to invoke protoc: {result:?}")
6162
}
6263

6364
let output = result.unwrap();
6465
if !output.status.success() {
65-
panic!("protoc failed: {:?}", output)
66+
panic!("protoc failed: {output:?}")
6667
}
6768

6869
let version_regex = Regex::new(r"(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)").unwrap();
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one or more
2+
// contributor license agreements. See the NOTICE file distributed with
3+
// this work for additional information regarding copyright ownership.
4+
// The ASF licenses this file to You under the Apache License, Version 2.0
5+
// (the "License"); you may not use this file except in compliance with
6+
// the License. You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
syntax = "proto3";
17+
18+
package apache.rocketmq.v2;
19+
20+
option cc_enable_arenas = true;
21+
option csharp_namespace = "Apache.Rocketmq.V2";
22+
option java_multiple_files = true;
23+
option java_package = "apache.rocketmq.v2";
24+
option java_generate_equals_and_hash = true;
25+
option java_string_check_utf8 = true;
26+
option java_outer_classname = "MQAdmin";
27+
28+
message ChangeLogLevelRequest {
29+
enum Level {
30+
TRACE = 0;
31+
DEBUG = 1;
32+
INFO = 2;
33+
WARN = 3;
34+
ERROR = 4;
35+
}
36+
Level level = 1;
37+
}
38+
39+
message ChangeLogLevelResponse { string remark = 1; }
40+
41+
service Admin {
42+
rpc ChangeLogLevel(ChangeLogLevelRequest) returns (ChangeLogLevelResponse) {}
43+
}

0 commit comments

Comments
 (0)