Expand description
Optional microservices transport primitives for nestrs (Phase 4 roadmap crate).
This crate intentionally starts with a tiny, stable interface so transports (NATS/Redis/gRPC) can be added incrementally without blocking core HTTP framework progress.
§Cross-cutting on message handlers
On #[micro_routes] impl blocks, per-handler attributes #[use_micro_interceptors(...)],
#[use_micro_guards(...)], and #[use_micro_pipes(...)] run before your
#[message_pattern] / #[event_pattern] body (order: interceptors → guards → pipes). This is
the closest analogue to Nest’s microservice pipes/guards/interceptors; there is no separate
exception-filter pipeline — return TransportError from handlers (the nestrs crate maps
HttpException into TransportError with JSON details in generated #[micro_routes] code).
Re-exports§
pub use wire::WIRE_FORMAT_DOC_REVISION;
Modules§
- custom
- Third-party and in-house transporters (Nest “custom transport” analogue).
- wire
- Shared JSON wire format for Redis, Kafka, MQTT, RabbitMQ, custom transporters, and the JSON
payloads carried by the gRPC adapter (
nestrs.microservicesproto).
Structs§
- Client
Config - Client
Proxy - Nest-like client proxy wrapper over a configured
Transport. - Clients
Module - Clients
Service - Event
Bus - In-process async event bus for integration/domain events.
- Kafka
Transport - Placeholder transport: enable the
kafkafeature and usesuper::KafkaTransportOptionsfor a real client. - Message
Envelope - Mqtt
Transport - Placeholder transport: enable the
mqttfeature for a realrumqttcclient. - OnEvent
Registration - Auto-wiring registration entry for
#[event_routes]+#[on_event("...")]handlers. - Rabbit
MqTransport - Placeholder transport: enable the
rabbitmqfeature for a reallapinclient. - TcpMicroservice
Options - TcpMicroservice
Server - TcpTransport
- Simple JSON-over-TCP transport (NestJS
Transport.TCPanalogue). - TcpTransport
Options - Transport
Error
Statics§
Traits§
- Micro
CanActivate - Authorization / policy hook before a microservice handler runs (Nest microservice guard analogue).
- Micro
Incoming Interceptor - Observe inbound patterns (logging / metrics); does not fail the pipeline.
- Micro
Pipe Transform - Transform inbound JSON after guards (Nest microservice pipe analogue).
- Microservice
Handler - A Nest-style microservice handler registry entrypoint (controller/service methods annotated with
#[message_pattern]/#[event_pattern]via the#[micro_routes]impl macro). - Microservice
Module - Implemented by
#[module(microservices = [...])]to declare which providers handle patterns. - Microservice
Server - Transport
Functions§
- handler_
factory - wire_
on_ event_ handlers - Subscribe all
#[on_event]handlers registered via#[event_routes].