Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version #237

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bigquery/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "google-cloud-bigquery"
version = "0.6.0"
version = "0.7.0"
edition = "2021"
authors = ["yoshidan <[email protected]>"]
repository = "https://github.com/yoshidan/google-cloud-rust/tree/main/bigquery"
Expand All @@ -22,9 +22,9 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version="1.32", features=["macros"] }
time = { version = "0.3", features = ["std", "macros", "formatting", "parsing", "serde"] }
arrow = { version="44.0", default-features = false, features = ["ipc"] }
arrow = { version="50.0", default-features = false, features = ["ipc"] }
base64 = "0.21"
bigdecimal = { version="0.3", features=["serde"] }
bigdecimal = { version="0.4", features=["serde"] }
num-bigint = "0.4"
backon = "0.4"
reqwest-middleware = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion foundation/auth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "google-cloud-auth"
version = "0.13.0"
version = "0.13.1"
authors = ["yoshidan <[email protected]>"]
edition = "2021"
repository = "https://github.com/yoshidan/google-cloud-rust/tree/main/foundation/auth"
Expand Down
2 changes: 1 addition & 1 deletion pubsub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "google-cloud-pubsub"
version = "0.22.1"
version = "0.23.0"
authors = ["yoshidan <[email protected]>"]
edition = "2021"
repository = "https://github.com/yoshidan/google-cloud-rust/tree/main/pubsub"
Expand Down
70 changes: 70 additions & 0 deletions pubsub/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,13 @@ mod tests_in_gcp {
use crate::client::{Client, ClientConfig};
use crate::publisher::PublisherConfig;
use google_cloud_gax::conn::Environment;
use google_cloud_gax::grpc::codegen::tokio_stream::StreamExt;
use google_cloud_googleapis::pubsub::v1::PubsubMessage;
use serial_test::serial;
use std::collections::HashMap;

use std::time::Duration;
use tokio_util::sync::CancellationToken;

fn make_msg(key: &str) -> PubsubMessage {
PubsubMessage {
Expand Down Expand Up @@ -581,4 +585,70 @@ mod tests_in_gcp {
tracing::info!("msg id {}", awaiter.get().await.unwrap());
}
}
#[tokio::test]
#[serial]
#[ignore]
async fn test_subscribe_exactly_once_delivery() {
let client = Client::new(ClientConfig::default().with_auth().await.unwrap())
.await
.unwrap();

// Check if the subscription is exactly_once_delivery
let subscription = client.subscription("eod-test");
let config = subscription.config(None).await.unwrap().1;
assert!(config.enable_exactly_once_delivery);

// publish message
let ctx = CancellationToken::new();
let ctx_pub = ctx.clone();
let publisher = client.topic("eod-test").new_publisher(None);
let pub_task = tokio::spawn(async move {
tracing::info!("start publisher");
loop {
if ctx_pub.is_cancelled() {
tracing::info!("finish publisher");
return;
}
publisher
.publish_blocking(PubsubMessage {
data: "msg".into(),
..Default::default()
})
.get()
.await
.unwrap();
}
});

// subscribe message
let ctx_sub = ctx.clone();
let sub_task = tokio::spawn(async move {
tracing::info!("start subscriber");
let mut stream = subscription.subscribe(None).await.unwrap();
let mut msgs = HashMap::new();
while let Some(message) = stream.next().await {
if ctx_sub.is_cancelled() {
break;
}
let msg_id = &message.message.message_id;
*msgs.entry(msg_id.clone()).or_insert(0) += 1;
message.ack().await.unwrap();
}
tracing::info!("finish subscriber");
msgs
});

tokio::time::sleep(Duration::from_secs(30)).await;

// check redelivered messages
ctx.cancel();
pub_task.await.unwrap();
let received_msgs = sub_task.await.unwrap();
assert!(!received_msgs.is_empty());

tracing::info!("Number of received messages = {}", received_msgs.len());
for (msg_id, count) in received_msgs {
assert_eq!(count, 1, "msg_id = {msg_id}, count = {count}");
}
}
}
2 changes: 1 addition & 1 deletion spanner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ parking_lot = "0.12"
base64 = "0.21"
serde = { version = "1.0", optional = true, features = ["derive"] }
tokio-util = "0.7"
bigdecimal = { version="0.3", features=["serde"] }
bigdecimal = { version="0.4", features=["serde"] }

google-cloud-token = { version = "0.1.1", path = "../foundation/token" }
google-cloud-longrunning = { version = "0.17.0", path = "../foundation/longrunning" }
Expand Down
2 changes: 1 addition & 1 deletion storage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "google-cloud-storage"
version = "0.15.0"
version = "0.16.0"
edition = "2021"
authors = ["yoshidan <[email protected]>"]
repository = "https://github.com/yoshidan/google-cloud-rust/tree/main/storage"
Expand Down
Loading