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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//! The Rust messaging framework for reliable event-driven services.
//!
//! Hexeract is an opinionated messaging framework for Rust. It unifies
//! in-process mediator dispatch, multi-broker bus transport, a
//! transactional outbox and a durable scheduler in a single ergonomic
//! crate. Sagas and request/reply are planned for future releases (see
//! [the roadmap](https://github.com/nubster-opensources/hexeract/blob/main/docs/explanation/roadmap.md)).
//!
//! This facade re-exports every shipped sub-crate behind opt-in
//! feature flags so consumers only compile what they actually use.
//!
//! # Quick start
//!
//! Outbox over PostgreSQL:
//!
//! ```toml
//! [dependencies]
//! hexeract = { version = "0.6", features = ["outbox-sql-postgres"] }
//! ```
//!
//! Bus over RabbitMQ:
//!
//! ```toml
//! [dependencies]
//! hexeract = { version = "0.6", features = ["bus-rabbitmq"] }
//! ```
//!
//! Both together:
//!
//! ```toml
//! [dependencies]
//! hexeract = { version = "0.6", features = ["outbox-sql-postgres", "bus-rabbitmq"] }
//! ```
//!
//! # Feature matrix
//!
//! | Feature | Enables | Pulls |
//! | --- | --- | --- |
//! | `core` | Cross-cutting primitives (`MessageId`, `CorrelationId`, `HandlerContext`) | [`hexeract_core`] |
//! | `outbox` | Backend-agnostic outbox traits | [`hexeract_outbox`] |
//! | `outbox-sql-postgres` | PostgreSQL outbox backend via `sqlx` | [`hexeract_outbox`] + [`hexeract_outbox_sql`] |
//! | `outbox-sql-mysql` | MySQL outbox backend via `sqlx` | [`hexeract_outbox`] + [`hexeract_outbox_sql`] |
//! | `outbox-sql-sqlite` | SQLite outbox backend via `sqlx` | [`hexeract_outbox`] + [`hexeract_outbox_sql`] |
//! | `bus` | Backend-agnostic bus traits | [`hexeract_bus`] |
//! | `bus-rabbitmq` | RabbitMQ bus backend | [`hexeract_bus`] + [`hexeract_bus_rabbitmq`] |
//! | `mediator` | In-process CQRS mediator | [`hexeract_mediator`] |
//! | `middleware` | Built-in tracing and timeout middlewares | [`hexeract_middleware`] |
//! | `macros` | `#[handler]` attribute macro for handler registration | [`hexeract_macros`] + [`hexeract_core`] |
//! | `scheduler` | Backend-agnostic scheduler traits and `SchedulerBuilder` | [`hexeract_scheduler`] |
//! | `scheduler-mediator` | Scheduler sink that dispatches via the in-process mediator | [`hexeract_scheduler`] + mediator |
//! | `scheduler-bus` | Scheduler sink that publishes via the message bus | [`hexeract_scheduler`] + bus |
//! | `scheduler-outbox` | Scheduler sink that enqueues into the transactional outbox | [`hexeract_scheduler`] |
//! | `scheduler-sql-postgres` | PostgreSQL schedule store via `sqlx` | [`hexeract_scheduler`] + [`hexeract_scheduler_sql`] |
//! | `scheduler-sql-mysql` | MySQL schedule store via `sqlx` | [`hexeract_scheduler`] + [`hexeract_scheduler_sql`] |
//! | `scheduler-sql-sqlite` | SQLite schedule store via `sqlx` | [`hexeract_scheduler`] + [`hexeract_scheduler_sql`] |
//!
//! Every feature transitively enables `core`, so a downstream user
//! automatically has access to `hexeract::core::HandlerContext`.
/// Cross-cutting primitives shared by every feature module.
///
/// Re-export of [`hexeract_core`].
pub use hexeract_core as core;
/// Backend-agnostic outbox traits.
///
/// Re-export of [`hexeract_outbox`].
pub use hexeract_outbox as outbox;
/// SQL outbox backends for PostgreSQL, MySQL and SQLite via `sqlx`.
///
/// Re-export of [`hexeract_outbox_sql`]. Enabled by any of the
/// `outbox-sql-postgres`, `outbox-sql-mysql` or `outbox-sql-sqlite` features.
pub use hexeract_outbox_sql as outbox_sql;
/// Backend-agnostic bus traits.
///
/// Re-export of [`hexeract_bus`].
pub use hexeract_bus as bus;
/// RabbitMQ bus backend.
///
/// Re-export of [`hexeract_bus_rabbitmq`].
pub use hexeract_bus_rabbitmq as bus_rabbitmq;
/// In-process CQRS mediator: command, query and notification dispatch.
///
/// Re-export of [`hexeract_mediator`].
pub use hexeract_mediator as mediator;
/// Built-in middlewares: tracing spans and dispatch timeouts.
///
/// Re-export of [`hexeract_middleware`].
pub use hexeract_middleware as middleware;
/// Procedural macros: the `#[handler]` attribute for handler registration.
///
/// Re-export of [`hexeract_macros`].
pub use hexeract_macros as macros;
/// Backend-agnostic scheduler traits and the validated `SchedulerBuilder`.
///
/// Re-export of [`hexeract_scheduler`].
pub use hexeract_scheduler as scheduler;
/// SQL schedule store backends for PostgreSQL, MySQL and SQLite via `sqlx`.
///
/// Re-export of [`hexeract_scheduler_sql`]. Enabled by any of the
/// `scheduler-sql-postgres`, `scheduler-sql-mysql` or `scheduler-sql-sqlite` features.
pub use hexeract_scheduler_sql as scheduler_sql;