Skip to content

Commit

Permalink
bumped version and updated changelog (0.12.0) (#274)
Browse files Browse the repository at this point in the history
* bumped version and updated changelog

* check examples in CI

* Fix mismatch of txn acquistion return type (#275)

* fix mismatch of return types of txn acquisition

* update example

* bumped version and updated changelog

* check examples in CI

* updated changelog

* Merge branch 'chore/bump-version-update-changelog-0-12-0' of https://github.com/minghuaw/fe2o3-amqp into chore/bump-version-update-changelog-0-12-0

* Added sasl_hostname and builder hostname is not overriden by url hostname (#276)

* bumped version and updated changelog

* check examples in CI

* updated changelog

* Merge branch 'chore/bump-version-update-changelog-0-12-0' of https://github.com/minghuaw/fe2o3-amqp into chore/bump-version-update-changelog-0-12-0

* updated examples

* gate example code behind cfg
  • Loading branch information
minghuaw authored Aug 7, 2024
1 parent 3480424 commit bf86c06
Show file tree
Hide file tree
Showing 21 changed files with 141 additions and 110 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ jobs:
run: (cd fe2o3-amqp-management && cargo make test)
- name: test fe2o3-amqp-ws
run: (cd fe2o3-amqp-ws && cargo make test)
- name: check examples
run: (cd examples && cargo make check)

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ exclude = [

[workspace.dependencies]
# Local deps
fe2o3-amqp = { path = "fe2o3-amqp", version = "0.11" }
fe2o3-amqp-cbs = { path = "fe2o3-amqp-cbs", version = "0.11" }
fe2o3-amqp-ext = { path = "fe2o3-amqp-ext", version = "0.11" }
fe2o3-amqp-management = { path = "fe2o3-amqp-management", version = "0.11" }
fe2o3-amqp-types = { path = "fe2o3-amqp-types", version = "0.11" }
fe2o3-amqp-ws = { path = "fe2o3-amqp-ws", version = "0.11" }
fe2o3-amqp = { path = "fe2o3-amqp", version = "0.12" }
fe2o3-amqp-cbs = { path = "fe2o3-amqp-cbs", version = "0.12" }
fe2o3-amqp-ext = { path = "fe2o3-amqp-ext", version = "0.12" }
fe2o3-amqp-management = { path = "fe2o3-amqp-management", version = "0.12" }
fe2o3-amqp-types = { path = "fe2o3-amqp-types", version = "0.12" }
fe2o3-amqp-ws = { path = "fe2o3-amqp-ws", version = "0.12" }
serde_amqp_derive = { path = "serde_amqp_derive", version = "0.3.0" }
serde_amqp = { path = "serde_amqp", version = "0.11" }
serde_amqp = { path = "serde_amqp", version = "0.12" }

# External deps
bytes = "1"
Expand Down
4 changes: 2 additions & 2 deletions examples/activemq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ fe2o3-amqp = { features = ["native-tls"], path = "../../fe2o3-amqp" }

tokio-native-tls = "0.3.0"
native-tls = "0.2.8"
tokio-rustls = "0.26.0"
rustls = "0.23.12"
tokio-rustls = { version = "0.26.0", default-features = false }
rustls = { version = "0.23.12", default-features = false }
webpki-roots = "0.26.3"
20 changes: 8 additions & 12 deletions examples/activemq/src/bin/rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,22 @@ use fe2o3_amqp::Connection;
use fe2o3_amqp::Sender;
use fe2o3_amqp::Session;
use fe2o3_amqp::sasl_profile::SaslProfile;
use rustls::pki_types::ServerName;
use rustls::ClientConfig;
use rustls::RootCertStore;
use tokio::net::TcpStream;
use tokio_rustls::TlsConnector;

#[tokio::main]
async fn main() {
let addr = "localhost:5671";
let domain = rustls::ServerName::try_from("localhost").unwrap();
let domain = ServerName::try_from("localhost").unwrap();
let stream = TcpStream::connect(addr).await.unwrap();

let mut root_store = rustls::RootCertStore::empty();
root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
rustls::OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
}));
let config = rustls::ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(root_store)
let mut root_cert_store = RootCertStore::empty();
root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
let config = ClientConfig::builder()
.with_root_certificates(root_cert_store)
.with_no_client_auth();
let connector = TlsConnector::from(Arc::new(config));
let tls_stream = connector.connect(domain, stream).await.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/alternative_tls_connection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] }
fe2o3-amqp = { features = [], path = "../../fe2o3-amqp" }
tokio-native-tls = "0.3.0"
native-tls = "0.2.8"
tokio-rustls = "0.26.0"
rustls = "0.23.12"
tokio-rustls = { version = "0.26.0", default-features = false }
rustls = { version = "0.23.12", default-features = false }
webpki-roots = "0.26.3"
20 changes: 8 additions & 12 deletions examples/alternative_tls_connection/src/bin/rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@ use std::sync::Arc;
use fe2o3_amqp::Connection;
use fe2o3_amqp::Sender;
use fe2o3_amqp::Session;
use rustls::pki_types::ServerName;
use rustls::ClientConfig;
use rustls::RootCertStore;
use tokio::net::TcpStream;
use tokio_rustls::TlsConnector;

#[tokio::main]
async fn main() {
let addr = "localhost:5671";
let domain = rustls::ServerName::try_from("localhost").unwrap();
let domain = ServerName::try_from("localhost").unwrap();
let stream = TcpStream::connect(addr).await.unwrap();

let mut root_store = rustls::RootCertStore::empty();
root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
rustls::OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
}));
let config = rustls::ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(root_store)
let mut root_cert_store = RootCertStore::empty();
root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
let config = ClientConfig::builder()
.with_root_certificates(root_cert_store)
.with_no_client_auth();
let connector = TlsConnector::from(Arc::new(config));
let tls_stream = connector.connect(domain, stream).await.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/rustls_connection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ edition = "2021"
[dependencies]
tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] }
fe2o3-amqp = { features = ["rustls"], path = "../../fe2o3-amqp" }
rustls = "0.23.12"
tokio-rustls = "0.26.0"
tokio-rustls = { version = "0.26.0", default-features = false }
rustls = { version = "0.23.12", default-features = false }
webpki-roots = "0.26"
4 changes: 2 additions & 2 deletions examples/service_bus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ management = ["fe2o3-amqp-management"]
[dependencies]
dotenv = "0.15.0"
tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] }
tokio-rustls = "0.26.0"
rustls = "0.23.12"
tokio-rustls = { version = "0.26.0", default-features = false }
rustls = { version = "0.23.12", default-features = false }
webpki-roots = "0.26.3"
fe2o3-amqp = { path = "../../fe2o3-amqp", features = ["rustls"] }
uuid = { version = "1", features = ["v4"] }
Expand Down
4 changes: 2 additions & 2 deletions examples/tls_sasl_connection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ native-tls = ["fe2o3-amqp/native-tls"]
[dependencies]
tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] }
fe2o3-amqp = { features = ["rustls"], path = "../../fe2o3-amqp" }
rustls = "0.23.12"
tokio-rustls = "0.26.0"
tokio-rustls = { version = "0.26.0", default-features = false }
rustls = { version = "0.23.12", default-features = false }
webpki-roots = "0.26"
127 changes: 69 additions & 58 deletions examples/wasm32-in-browser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,60 +1,71 @@
use fe2o3_amqp::{Connection, sasl_profile::SaslProfile, Session, Sender, Receiver};
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::spawn_local;
macro_rules! cfg_wasm32 {
($($item:item)*) => {
$(
#[cfg(target_arch = "wasm32")]
$item
)*
};
}

#[wasm_bindgen]
pub fn run() {
std::panic::set_hook(Box::new(console_error_panic_hook::hook));

spawn_local(async {
let local_set = tokio::task::LocalSet::new();
local_set.run_until(async {
use fe2o3_amqp_ws::WebSocketStream;
use web_sys::console;

// This example uses the Azure Service Bus as the AMQP broker because it provides
// a WebSocket endpoint.
let hostname = "<NAMESPACE>.servicebus.windows.net";
let sa_key_name = "<SharedAccessKeyName>";
let sa_key_value = "<SharedAccessKey>";

let ws_address = format!("wss://{sa_key_name}:{sa_key_value}@{hostname}/$servicebus/websocket");
console::log_1(&format!("Connecting to {}", ws_address).into());
let ws_stream = WebSocketStream::connect(ws_address).await.unwrap();

let mut connection = Connection::builder()
.container_id("wasm-client")
.scheme("amqp")
.hostname(hostname)
.sasl_profile(SaslProfile::Plain {
username: sa_key_name.into(),
password: sa_key_value.into(),
})
.open_with_stream_on_local_set(ws_stream, &local_set)
.await
.unwrap();
console::log_1(&"Connection connected".into());

let mut session = Session::builder()
.begin_on_local_set(&mut connection, &local_set).await.unwrap();

console::log_1(&"Session connected".into());

let mut sender = Sender::attach(&mut session, "wasm-sender", "q1").await.unwrap();
sender.send("message from wasm").await.unwrap();
sender.close().await.unwrap();
console::log_1(&"Sender closed".into());

let mut receiver = Receiver::attach(&mut session, "wasm-receiver", "q1").await.unwrap();
let delivery = receiver.recv::<String>().await.unwrap();
receiver.accept(&delivery).await.unwrap();
console::log_1(&format!("Received: {}", delivery.body()).into());
receiver.close().await.unwrap();

drop(session);
drop(connection);

console::log_1(&"Connection and session closed".into());
}).await;
})
cfg_wasm32! {
use fe2o3_amqp::{Connection, sasl_profile::SaslProfile, Session, Sender, Receiver};
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::spawn_local;

#[wasm_bindgen]
pub fn run() {
std::panic::set_hook(Box::new(console_error_panic_hook::hook));

spawn_local(async {
let local_set = tokio::task::LocalSet::new();
local_set.run_until(async {
use fe2o3_amqp_ws::WebSocketStream;
use web_sys::console;

// This example uses the Azure Service Bus as the AMQP broker because it provides
// a WebSocket endpoint.
let hostname = "<NAMESPACE>.servicebus.windows.net";
let sa_key_name = "<SharedAccessKeyName>";
let sa_key_value = "<SharedAccessKey>";

let ws_address = format!("wss://{sa_key_name}:{sa_key_value}@{hostname}/$servicebus/websocket");
console::log_1(&format!("Connecting to {}", ws_address).into());
let ws_stream = WebSocketStream::connect(ws_address).await.unwrap();

let mut connection = Connection::builder()
.container_id("wasm-client")
.scheme("amqp")
.hostname(hostname)
.sasl_profile(SaslProfile::Plain {
username: sa_key_name.into(),
password: sa_key_value.into(),
})
.open_with_stream_on_local_set(ws_stream, &local_set)
.await
.unwrap();
console::log_1(&"Connection connected".into());

let mut session = Session::builder()
.begin_on_local_set(&mut connection, &local_set).await.unwrap();

console::log_1(&"Session connected".into());

let mut sender = Sender::attach(&mut session, "wasm-sender", "q1").await.unwrap();
sender.send("message from wasm").await.unwrap();
sender.close().await.unwrap();
console::log_1(&"Sender closed".into());

let mut receiver = Receiver::attach(&mut session, "wasm-receiver", "q1").await.unwrap();
let delivery = receiver.recv::<String>().await.unwrap();
receiver.accept(&delivery).await.unwrap();
console::log_1(&format!("Received: {}", delivery.body()).into());
receiver.close().await.unwrap();

drop(session);
drop(connection);

console::log_1(&"Connection and session closed".into());
}).await;
})
}
}
2 changes: 1 addition & 1 deletion fe2o3-amqp-cbs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fe2o3-amqp-cbs"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
description = "An experimental impl of AMQP 1.0 CBS extension"
license = "MIT/Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion fe2o3-amqp-ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fe2o3-amqp-ext"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
description = "Extension types to fe2o3-amqp"
license = "MIT/Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion fe2o3-amqp-management/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fe2o3-amqp-management"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
description = "An experimental impl of AMQP 1.0 management extension"
license = "MIT/Apache-2.0"
Expand Down
4 changes: 4 additions & 0 deletions fe2o3-amqp-management/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.12.0

1. Display `InvalidType` info in `DecodeError`

## 0.11.0

1. Updated deps
Expand Down
2 changes: 1 addition & 1 deletion fe2o3-amqp-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fe2o3-amqp-types"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
description = "Implementation of AMQP1.0 data types"
license = "MIT/Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion fe2o3-amqp-ws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fe2o3-amqp-ws"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
description = "WebSocket binding stream for AMQP1.0"
license = "MIT/Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion fe2o3-amqp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fe2o3-amqp"
version = "0.11.1"
version = "0.12.0"
edition = "2021"
description = "An implementation of AMQP1.0 protocol based on serde and tokio"
license = "MIT/Apache-2.0"
Expand Down
21 changes: 18 additions & 3 deletions fe2o3-amqp/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# Change Log

## 0.12.0

### Breaking

1. The `properties` field in the `Flow` performative is no longer included by default.
A new function `Receiver::send_properties` is added to allow user to explicitly send
the properties.
2. Changed returns types of `TransactionAcquistion` methods

### Minor

1. Fixed typo in the docs

## 0.11.1

1. Fixed typo in documentation

## 0.11.0

### Breaking changes
### Breaking

1. Corrected typo in the name of `SessionBuilder::outgoing_widnow` and `SessionAcceptor::outgoing_widnow`, they are now `SessionBuilder::outgoing_window` and `SessionAcceptor::outgoing_window`.
1. Corrected typo in the name of `SessionBuilder::outgoing_widnow` and
`SessionAcceptor::outgoing_widnow`, they are now `SessionBuilder::outgoing_window`
and `SessionAcceptor::outgoing_window`.
2. Updated dependencies
1. base64
2. rustls, tokio-rustls
3. Removed deprecated functions

### Minor changes
### Minor

1. Fixed typo in documentation

Expand Down
2 changes: 1 addition & 1 deletion fe2o3-amqp/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ default = []
2. [Listener](#listener)
3. [WebSocket binding](#websocket)

More examples including one showing how to use it with Azure Serivce Bus can be found on the
More examples including one showing how to use it with Azure Service Bus can be found on the
[GitHub repo](https://github.com/minghuaw/fe2o3-amqp/tree/main/examples).

### Client
Expand Down
2 changes: 1 addition & 1 deletion serde_amqp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_amqp"
version = "0.11.1"
version = "0.12.0"
edition = "2021"
description = "A serde implementation of AMQP1.0 protocol."
license = "MIT/Apache-2.0"
Expand Down
Loading

0 comments on commit bf86c06

Please sign in to comment.