1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! NATS `JetStream` [`StoragePort`](photon_backend::StoragePort) for distributed Photon delivery.
//!
//! Wraps `JetStream` consumer groups, checkpoint persistence, and stream sharding behind the shared
//! storage contract. Enable via the `nats` feature on the
//! [`photon`](https://docs.rs/uf-photon/latest/photon/) facade.
//!
//! Connection and stream options: [`NatsConfig`] and [`NatsStoragePortBuilder`]
//! (builder methods + env fallbacks documented on the builder).
//!
//! Wire with [`PhotonBuilder::storage_port`](https://docs.rs/uf-photon/latest/photon/struct.PhotonBuilder.html#method.storage_port)
//! after [`NatsStoragePortBuilder::build`](NatsStoragePortBuilder::build).
//!
//! ## Entry points
//!
//! - [`NatsStoragePort`] — `JetStream` storage adapter
//! - [`NatsConfig`] / [`NatsStoragePortBuilder`] — connection and stream options
//! - [`nats_url_from_env`] — resolve broker URL from environment
//!
//! Performance methodology: [`photon-bench/PERFORMANCE_STUDY.md`](../../photon-bench/PERFORMANCE_STUDY.md).
//!
//! ## Topic mapping (NATS)
//!
//! - **Subject:** `photon.{topic}` when `stream_shards = 1`; `photon-s.{shard}.{topic}` when sharded.
//! - **`JetStream` stream:** default `photon` with `photon.>`; sharded mode uses `photon-0`…`photon-(K-1)`.
//! - **Checkpoints:** KV bucket `photon-checkpoints` (skipped when [`ReplayCursor::TailOnly`]).
//! - **Replay:** [`ReplayCursor::StreamSeq`] uses `JetStream` stream sequence; [`ReplayCursor::TailOnly`] tails live only.
pub use ;
pub use STREAM_SHARDS_ENV;
pub use ;
pub use REPLICAS_ENV;
pub use ;
pub use RETENTION_ENV;