diff --git a/CHANGELOG.md b/CHANGELOG.md index 877499d..5b061fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### ⚠️ Operational migrations +- **The default provider is now Iggy.** The default feature set is + `iggy, encryption, cloudevents, routing`; NATS becomes opt-in via the + `nats` feature. Consumers that relied on the default providing NATS must + add `features = ["nats"]`. Note the known upstream Iggy restart issue + (apache/iggy#4361) before choosing Iggy for production restart-heavy + deployments. + - **NATS durable consumer names are now sanitized.** `EventBus` used to build consumer names as `{subscriber}-{subject with '.'→'-'}`; subjects also contain `*` and `>`, which JetStream rejects outright (`error 10103`). The diff --git a/Cargo.toml b/Cargo.toml index f27136d..e98e40b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ name = "a3s_event" path = "src/lib.rs" [features] -default = ["nats", "encryption", "cloudevents", "routing"] +default = ["iggy", "encryption", "cloudevents", "routing"] nats = ["dep:async-nats", "dep:time", "dep:futures-util"] iggy = ["dep:iggy", "dep:bytes"] encryption = ["dep:aes-gcm", "dep:base64"] diff --git a/README.md b/README.md index b075036..a2809f2 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ All optional modules are behind feature gates. The minimal core (types, memory p | Feature | Default | Description | |---------|---------|-------------| -| `nats` | ✅ | NATS JetStream provider (`async-nats`, `futures-util`, `time`) | -| `iggy` | — | Apache Iggy provider (`iggy`, `bytes`) | +| `iggy` | ✅ | Apache Iggy provider (`iggy`, `bytes`) — the default backend | +| `nats` | — | NATS JetStream provider (`async-nats`, `futures-util`, `time`) | | `encryption` | ✅ | AES-256-GCM payload encryption (`aes-gcm`, `base64`) | | `cloudevents` | ✅ | CloudEvents v1.0 conversion (`chrono`) | | `routing` | ✅ | Broker/Trigger event routing + Sink DLQ | @@ -83,8 +83,8 @@ a3s-event = { version = "0.3", default-features = false, features = ["nats", "en | Provider | Use Case | Persistence | Distribution | |----------|----------|-------------|--------------| | `MemoryProvider` | Testing, development, single-process | In-process only | Single process | -| `NatsProvider` | Production, multi-service | JetStream (file/memory) | Distributed | -| `IggyProvider` | Production, multi-service, Rust-native broker | Iggy stream (per-topic log) | Distributed | +| `IggyProvider` | **Default.** Production, multi-service, Rust-native broker | Iggy stream (per-topic log) | Distributed | +| `NatsProvider` | Opt-in (`nats` feature). Production, multi-service | JetStream (file/memory) | Distributed | ### Memory Provider diff --git a/src/lib.rs b/src/lib.rs index 88c21be..9d2bd42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,8 +35,8 @@ //! ## Providers //! //! - **memory** — In-memory provider for testing and single-process use -//! - **nats** — NATS JetStream for distributed, persistent event streaming -//! - **iggy** — Apache Iggy for persistent, distributed event streaming +//! - **iggy** — Apache Iggy (DEFAULT) for persistent, distributed event streaming +//! - **nats** — NATS JetStream, opt-in via the `nats` feature //! //! ## Architecture //! diff --git a/tests/e2e_chaos_resilience.rs b/tests/e2e_chaos_resilience.rs index e80fb0b..75bbb14 100644 --- a/tests/e2e_chaos_resilience.rs +++ b/tests/e2e_chaos_resilience.rs @@ -250,8 +250,12 @@ async fn iggy_personal_access_token_login_flows_end_to_end() { .with_server_address("127.0.0.1:5102".to_string()) .build() .unwrap(); - if let Err(e) = admin.login_user("iggy", "iggy").await { - eprintln!("Iggy unavailable ({e}), skipping PAT test"); + // The raw SDK dial has no built-in bound (the provider wraps its own + // connect in a timeout) — bound it here so a dead server skips instead + // of hanging the default-feature test run. + let login = tokio::time::timeout(Duration::from_secs(5), admin.login_user("iggy", "iggy")); + if let Err(_) | Ok(Err(_)) = login.await { + eprintln!("Iggy unavailable, skipping PAT test"); return; } let pat = match admin