Releases: nubster-opensources/hexeract
Releases · nubster-opensources/hexeract
v0.5.0
See CHANGELOG.md for details.
v0.4.0
See CHANGELOG.md for details.
v0.3.1
See CHANGELOG.md for details.
v0.3.0
v0.3.0: Mediator CQRS, built-in middlewares, #[handler] macro
v0.2.0
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:Messagemarker trait with an associatedMESSAGE_TYPE: &'static strfor stable routing.BusEnvelopewire representation with a customDebugimpl that masks the payload bytes to avoid leaking message content into traces. Includes arestoreconstructor for backend implementations.BusErrorenum with variantsSerialization,Transport,Connection,MissingHandler,TypeMismatch,InvalidTopologyandInternal.Transportasync trait (viaasync_trait) withpublishandpublish_with_headersmethods generic overM: Message, returning the freshly mintedmessage_id.Handler<M: Message>async trait decorated with#[trait_variant::make(Send)]and a handler-definedError: Into<BusError>, symmetric withhexeract_outbox::Handler<E>.ErasedHandlertrait andTypedHandler<M, H>adapter for runtime dispatch byMESSAGE_TYPE.- Topology types
Exchange,ExchangeKind(Direct,Topic,Fanout,Headers),Queue,RoutingKeynewtype,Binding. Each is validated on construction (<= 127 byte names,<= 255 byte routing keys, no ASCII control characters) andSerialize+Deserializeround-trips re-run the validation throughtry_from.
hexeract-bus-rabbitmq:RabbitMqConnectionwrapper overlapin::Connectionwith single-shotconnectand bounded exponential-backoffconnect_with_retry.ChannelPoolper-publisher pool oflapin::Channelhandles withPooledChannelRAII guard that returns the channel to the pool on drop, on a best-effort basis.RabbitMqTransportimplementingTransport.new(uri)targets the AMQP default exchange;with_exchange(uri, exchange)declares and uses a typedExchange. Publishes carry theBusEnvelopeas JSON with AMQP properties (message_id,correlation_id,content_type,type, optionalreply_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. RabbitMqWorkerconsumer worker withRabbitMqWorkerBuilderfluent API mirroringPgOutboxWorkerBuilder. SupportsAckMode::AutoandAckMode::Manual; manual mode appliesbasic_nack(requeue=true)up tomax_attempts(counter keyed onmessage_idto survive redeliveries) before publishing to the configured dead-letter routing key or dropping. Graceful shutdown viaCancellationToken.- End-to-end runnable example
examples/03_bus_pubsub.rsspinning up a RabbitMQ container viatestcontainers, declaring topology, spawning the worker, publishing five messages and asserting consumption under one second.
hexeract-cli:bussubcommand namespace:hexeract bus declare --conn URL --topology FILEapplies a TOML topology (validated through the bus constructors);hexeract bus peek --conn URL --queue NAME [--count N]dumps the firstNmessages of a queue non-destructively (each delivery isbasic_nack(requeue=true)-ed after print);hexeract bus purge --conn URL --queue NAME --yes-i-knowdrops every message from a queue, gated by the same safety flag asoutbox 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
See CHANGELOG.md for details.