From 8cbcce55ba7ec2ed175cb304f127baae31a9a72e Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Thu, 4 Aug 2022 10:14:24 +0800 Subject: [PATCH 01/10] Update producer.rs --- src/producer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/producer.rs b/src/producer.rs index e0b65b8..7669751 100644 --- a/src/producer.rs +++ b/src/producer.rs @@ -1081,8 +1081,8 @@ impl<'a, T, Exe: Executor> MessageBuilder<'a, T, Exe> { self } /// sets the message's ordering key for key_shared subscription - pub fn with_ordering_key>(mut self, partition_key: S) -> Self { - self.partition_key = Some(partition_key.into()); + pub fn with_ordering_key>>(mut self, ordering_key: S) -> Self { + self.ordering_key = Some(ordering_key.into()); self } From 1ca8b0a4f70449c63826d0354f6bcb6a43715cdb Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 15:30:54 +0800 Subject: [PATCH 02/10] forward ordering key set ordering key to message --- src/connection.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/connection.rs b/src/connection.rs index 2faae5c..1aae2f1 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -1473,6 +1473,7 @@ pub(crate) mod messages { publish_time: Utc::now().timestamp_millis() as u64, replicated_from: None, partition_key: message.partition_key, + ordering_key: message.ordering_key, replicate_to: message.replicate_to, compression: message.compression, uncompressed_size: message.uncompressed_size, From e96621ad2088744080c557fac7ee2e08d7f45ab3 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:07:29 +0800 Subject: [PATCH 03/10] downgrade dependency --- Cargo.toml | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2087a3e..73e6a99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,11 +18,14 @@ keywords = ["pulsar", "api", "client"] [dependencies] bytes = "^1.4.0" crc = "^3.0.1" -nom = { version="^7.1.3", default-features=false, features=["alloc"] } +nom = { version = "^7.1.3", default-features = false, features = ["alloc"] } prost = "^0.11.9" prost-derive = "^0.11.9" rand = "^0.8.5" -chrono = { version = "^0.4.26", default-features = false, features = ["clock", "std"] } +chrono = { version = "^0.4.26", default-features = false, features = [ + "clock", + "std", +] } futures-timer = "^3.0.2" log = "^0.4.19" url = "^2.4.0" @@ -34,11 +37,18 @@ native-tls = { version = "^0.2.11", optional = true } rustls = { version = "^0.21.5", optional = true } webpki-roots = { version = "^0.25.1", optional = true } pem = "^3.0.0" -tokio = { version = "^1.29.1", features = ["rt", "net", "time"], optional = true } +tokio = { version = "^1.29.1", features = [ + "rt", + "net", + "time", +], optional = true } tokio-util = { version = "^0.7.8", features = ["codec"], optional = true } tokio-rustls = { version = "^0.24.1", optional = true } tokio-native-tls = { version = "^0.3.1", optional = true } -async-std = { version = "^1.12.0", features = [ "attributes", "unstable" ], optional = true } +async-std = { version = "^1.12.0", features = [ + "attributes", + "unstable", +], optional = true } asynchronous-codec = { version = "^0.6.2", optional = true } async-rustls = { version = "^0.4.0", optional = true } async-native-tls = { version = "^0.5.0", optional = true } @@ -51,7 +61,7 @@ oauth2 = { version = "^4.4.1", optional = true } serde = { version = "^1.0.175", features = ["derive"], optional = true } serde_json = { version = "^1.0.103", optional = true } tracing = { version = "^0.1.37", optional = true } -async-trait = "^0.1.72" +async-trait = "^0.1.68" data-url = { version = "^0.3.0", optional = true } uuid = { version = "^1.4.1", features = ["v4", "fast-rng"] } @@ -66,12 +76,29 @@ prost-build = "^0.11.9" protobuf-src = { version = "1.1.0", optional = true } [features] -default = [ "compression", "tokio-runtime", "async-std-runtime", "auth-oauth2"] -compression = [ "lz4", "flate2", "zstd", "snap" ] -tokio-runtime = [ "tokio", "tokio-util", "native-tls", "tokio-native-tls" ] -tokio-rustls-runtime = ["tokio", "tokio-util", "tokio-rustls", "rustls", "webpki-roots" ] -async-std-runtime = [ "async-std", "asynchronous-codec", "native-tls", "async-native-tls" ] -async-std-rustls-runtime = ["async-std", "asynchronous-codec", "async-rustls", "rustls", "webpki-roots" ] -auth-oauth2 = [ "openidconnect", "oauth2", "serde", "serde_json", "data-url" ] +default = ["compression", "tokio-runtime", "async-std-runtime", "auth-oauth2"] +compression = ["lz4", "flate2", "zstd", "snap"] +tokio-runtime = ["tokio", "tokio-util", "native-tls", "tokio-native-tls"] +tokio-rustls-runtime = [ + "tokio", + "tokio-util", + "tokio-rustls", + "rustls", + "webpki-roots", +] +async-std-runtime = [ + "async-std", + "asynchronous-codec", + "native-tls", + "async-native-tls", +] +async-std-rustls-runtime = [ + "async-std", + "asynchronous-codec", + "async-rustls", + "rustls", + "webpki-roots", +] +auth-oauth2 = ["openidconnect", "oauth2", "serde", "serde_json", "data-url"] telemetry = ["tracing"] protobuf-src = ["dep:protobuf-src"] From 925c8e0ed0e32f1666971dce32e2f9ce277013d0 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:15:50 +0800 Subject: [PATCH 04/10] downgrade dep version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 73e6a99..bbc2aac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ async-std = { version = "^1.12.0", features = [ "attributes", "unstable", ], optional = true } -asynchronous-codec = { version = "^0.6.2", optional = true } +asynchronous-codec = { version = "^0.6.1", optional = true } async-rustls = { version = "^0.4.0", optional = true } async-native-tls = { version = "^0.5.0", optional = true } lz4 = { version = "^1.24.0", optional = true } From cf705a4c13a4c148fabf2ba86a005f19f4478589 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:19:44 +0800 Subject: [PATCH 05/10] download dependency --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bbc2aac..dc665ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ nom = { version = "^7.1.3", default-features = false, features = ["alloc"] } prost = "^0.11.9" prost-derive = "^0.11.9" rand = "^0.8.5" -chrono = { version = "^0.4.26", default-features = false, features = [ +chrono = { version = "^0.4.24", default-features = false, features = [ "clock", "std", ] } From 9fe65c638596be64fe65974309d3f924646e8a59 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:23:26 +0800 Subject: [PATCH 06/10] downgrade dependency --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dc665ac..69a151c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ serde = { version = "^1.0.175", features = ["derive"], optional = true } serde_json = { version = "^1.0.103", optional = true } tracing = { version = "^0.1.37", optional = true } async-trait = "^0.1.68" -data-url = { version = "^0.3.0", optional = true } +data-url = { version = "^0.2.0", optional = true } uuid = { version = "^1.4.1", features = ["v4", "fast-rng"] } [dev-dependencies] From e7558bd90d51a4e87faea201826d5caa9730ac25 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:29:04 +0800 Subject: [PATCH 07/10] Revert "downgrade dependency" This reverts commit 9fe65c638596be64fe65974309d3f924646e8a59. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 69a151c..dc665ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ serde = { version = "^1.0.175", features = ["derive"], optional = true } serde_json = { version = "^1.0.103", optional = true } tracing = { version = "^0.1.37", optional = true } async-trait = "^0.1.68" -data-url = { version = "^0.2.0", optional = true } +data-url = { version = "^0.3.0", optional = true } uuid = { version = "^1.4.1", features = ["v4", "fast-rng"] } [dev-dependencies] From 7a4a50913d2ec7433ed773115e2b43ae840142a5 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:29:06 +0800 Subject: [PATCH 08/10] Revert "download dendency" This reverts commit cf705a4c13a4c148fabf2ba86a005f19f4478589. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dc665ac..bbc2aac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ nom = { version = "^7.1.3", default-features = false, features = ["alloc"] } prost = "^0.11.9" prost-derive = "^0.11.9" rand = "^0.8.5" -chrono = { version = "^0.4.24", default-features = false, features = [ +chrono = { version = "^0.4.26", default-features = false, features = [ "clock", "std", ] } From a5efdbc45375d3b48579af91a00ce089f1e1be80 Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:29:08 +0800 Subject: [PATCH 09/10] Revert "downgrade dep version" This reverts commit 925c8e0ed0e32f1666971dce32e2f9ce277013d0. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bbc2aac..73e6a99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ async-std = { version = "^1.12.0", features = [ "attributes", "unstable", ], optional = true } -asynchronous-codec = { version = "^0.6.1", optional = true } +asynchronous-codec = { version = "^0.6.2", optional = true } async-rustls = { version = "^0.4.0", optional = true } async-native-tls = { version = "^0.5.0", optional = true } lz4 = { version = "^1.24.0", optional = true } From 792872d27d0c958781cd75e75f90c817697b88fa Mon Sep 17 00:00:00 2001 From: Qian Wu Date: Tue, 29 Aug 2023 16:29:09 +0800 Subject: [PATCH 10/10] Revert "downgrade dependency" This reverts commit e96621ad2088744080c557fac7ee2e08d7f45ab3. --- Cargo.toml | 51 ++++++++++++--------------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 73e6a99..2087a3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,14 +18,11 @@ keywords = ["pulsar", "api", "client"] [dependencies] bytes = "^1.4.0" crc = "^3.0.1" -nom = { version = "^7.1.3", default-features = false, features = ["alloc"] } +nom = { version="^7.1.3", default-features=false, features=["alloc"] } prost = "^0.11.9" prost-derive = "^0.11.9" rand = "^0.8.5" -chrono = { version = "^0.4.26", default-features = false, features = [ - "clock", - "std", -] } +chrono = { version = "^0.4.26", default-features = false, features = ["clock", "std"] } futures-timer = "^3.0.2" log = "^0.4.19" url = "^2.4.0" @@ -37,18 +34,11 @@ native-tls = { version = "^0.2.11", optional = true } rustls = { version = "^0.21.5", optional = true } webpki-roots = { version = "^0.25.1", optional = true } pem = "^3.0.0" -tokio = { version = "^1.29.1", features = [ - "rt", - "net", - "time", -], optional = true } +tokio = { version = "^1.29.1", features = ["rt", "net", "time"], optional = true } tokio-util = { version = "^0.7.8", features = ["codec"], optional = true } tokio-rustls = { version = "^0.24.1", optional = true } tokio-native-tls = { version = "^0.3.1", optional = true } -async-std = { version = "^1.12.0", features = [ - "attributes", - "unstable", -], optional = true } +async-std = { version = "^1.12.0", features = [ "attributes", "unstable" ], optional = true } asynchronous-codec = { version = "^0.6.2", optional = true } async-rustls = { version = "^0.4.0", optional = true } async-native-tls = { version = "^0.5.0", optional = true } @@ -61,7 +51,7 @@ oauth2 = { version = "^4.4.1", optional = true } serde = { version = "^1.0.175", features = ["derive"], optional = true } serde_json = { version = "^1.0.103", optional = true } tracing = { version = "^0.1.37", optional = true } -async-trait = "^0.1.68" +async-trait = "^0.1.72" data-url = { version = "^0.3.0", optional = true } uuid = { version = "^1.4.1", features = ["v4", "fast-rng"] } @@ -76,29 +66,12 @@ prost-build = "^0.11.9" protobuf-src = { version = "1.1.0", optional = true } [features] -default = ["compression", "tokio-runtime", "async-std-runtime", "auth-oauth2"] -compression = ["lz4", "flate2", "zstd", "snap"] -tokio-runtime = ["tokio", "tokio-util", "native-tls", "tokio-native-tls"] -tokio-rustls-runtime = [ - "tokio", - "tokio-util", - "tokio-rustls", - "rustls", - "webpki-roots", -] -async-std-runtime = [ - "async-std", - "asynchronous-codec", - "native-tls", - "async-native-tls", -] -async-std-rustls-runtime = [ - "async-std", - "asynchronous-codec", - "async-rustls", - "rustls", - "webpki-roots", -] -auth-oauth2 = ["openidconnect", "oauth2", "serde", "serde_json", "data-url"] +default = [ "compression", "tokio-runtime", "async-std-runtime", "auth-oauth2"] +compression = [ "lz4", "flate2", "zstd", "snap" ] +tokio-runtime = [ "tokio", "tokio-util", "native-tls", "tokio-native-tls" ] +tokio-rustls-runtime = ["tokio", "tokio-util", "tokio-rustls", "rustls", "webpki-roots" ] +async-std-runtime = [ "async-std", "asynchronous-codec", "native-tls", "async-native-tls" ] +async-std-rustls-runtime = ["async-std", "asynchronous-codec", "async-rustls", "rustls", "webpki-roots" ] +auth-oauth2 = [ "openidconnect", "oauth2", "serde", "serde_json", "data-url" ] telemetry = ["tracing"] protobuf-src = ["dep:protobuf-src"]