Skip to content

Releases: nubster-opensources/hexeract

v0.5.0

12 Jun 14:36
83b4841

Choose a tag to compare

See CHANGELOG.md for details.

v0.4.0

02 Jun 17:42
34b2002

Choose a tag to compare

See CHANGELOG.md for details.

v0.3.1

31 May 08:43
e9433a1

Choose a tag to compare

See CHANGELOG.md for details.

v0.3.0

29 May 09:50
35abd51

Choose a tag to compare

v0.3.0: Mediator CQRS, built-in middlewares, #[handler] macro

v0.2.0

26 May 13:40
e3b37dd

Choose a tag to compare

Second public release. Ships the Bus feature end to end against RabbitMQ via lapin, alongside topology types, a typed consumer worker with ack modes and retry policy, an end-to-end pub/sub example and a hexeract bus CLI namespace.

Added

  • hexeract-bus:
    • Message marker trait with an associated MESSAGE_TYPE: &'static str for stable routing.
    • BusEnvelope wire representation with a custom Debug impl that masks the payload bytes to avoid leaking message content into traces. Includes a restore constructor for backend implementations.
    • BusError enum with variants Serialization, Transport, Connection, MissingHandler, TypeMismatch, InvalidTopology and Internal.
    • Transport async trait (via async_trait) with publish and publish_with_headers methods generic over M: Message, returning the freshly minted message_id.
    • Handler<M: Message> async trait decorated with #[trait_variant::make(Send)] and a handler-defined Error: Into<BusError>, symmetric with hexeract_outbox::Handler<E>.
    • ErasedHandler trait and TypedHandler<M, H> adapter for runtime dispatch by MESSAGE_TYPE.
    • Topology types Exchange, ExchangeKind (Direct, Topic, Fanout, Headers), Queue, RoutingKey newtype, Binding. Each is validated on construction (<= 127 byte names, <= 255 byte routing keys, no ASCII control characters) and Serialize + Deserialize round-trips re-run the validation through try_from.
  • hexeract-bus-rabbitmq:
    • RabbitMqConnection wrapper over lapin::Connection with single-shot connect and bounded exponential-backoff connect_with_retry.
    • ChannelPool per-publisher pool of lapin::Channel handles with PooledChannel RAII guard that returns the channel to the pool on drop, on a best-effort basis.
    • RabbitMqTransport implementing Transport. new(uri) targets the AMQP default exchange; with_exchange(uri, exchange) declares and uses a typed Exchange. Publishes carry the BusEnvelope as JSON with AMQP properties (message_id, correlation_id, content_type, type, optional reply_to, free-form headers).
    • Topology declaration helpers (declare_exchange, declare_queue, bind_queue, ensure_topology) for development convenience; long-running services should declare topology at startup, not on the publish hot path.
    • RabbitMqWorker consumer worker with RabbitMqWorkerBuilder fluent API mirroring PgOutboxWorkerBuilder. Supports AckMode::Auto and AckMode::Manual; manual mode applies basic_nack(requeue=true) up to max_attempts (counter keyed on message_id to survive redeliveries) before publishing to the configured dead-letter routing key or dropping. Graceful shutdown via CancellationToken.
    • End-to-end runnable example examples/03_bus_pubsub.rs spinning up a RabbitMQ container via testcontainers, declaring topology, spawning the worker, publishing five messages and asserting consumption under one second.
  • hexeract-cli:
    • bus subcommand namespace: hexeract bus declare --conn URL --topology FILE applies a TOML topology (validated through the bus constructors); hexeract bus peek --conn URL --queue NAME [--count N] dumps the first N messages of a queue non-destructively (each delivery is basic_nack(requeue=true)-ed after print); hexeract bus purge --conn URL --queue NAME --yes-i-know drops every message from a queue, gated by the same safety flag as outbox apply.
    • Sample topology file at crates/hexeract-cli/examples/topology.toml.

Documentation

  • README extended with a Bus (RabbitMQ) quick start covering the SDK snippet, the three CLI subcommands and a production note about declaring topology at startup.
  • ROADMAP marks v0.2.0 as delivered.

Notes for upgraders

This is a non-breaking addition for projects already on v0.1.0: hexeract-outbox, hexeract-outbox-postgres and the existing hexeract outbox CLI keep their v0.1.0 surface. Adding the bus is a matter of pulling the two new crates and the new CLI namespace.

v0.1.0

24 May 14:24
e5d0584

Choose a tag to compare

See CHANGELOG.md for details.