Skip to main content

Crate nestrs_microservices

Crate nestrs_microservices 

Source
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.microservices proto).

Structs§

ClientConfig
ClientProxy
Nest-like client proxy wrapper over a configured Transport.
ClientsModule
ClientsService
EventBus
In-process async event bus for integration/domain events.
KafkaTransport
Placeholder transport: enable the kafka feature and use super::KafkaTransportOptions for a real client.
MessageEnvelope
MqttTransport
Placeholder transport: enable the mqtt feature for a real rumqttc client.
OnEventRegistration
Auto-wiring registration entry for #[event_routes] + #[on_event("...")] handlers.
RabbitMqTransport
Placeholder transport: enable the rabbitmq feature for a real lapin client.
TcpMicroserviceOptions
TcpMicroserviceServer
TcpTransport
Simple JSON-over-TCP transport (NestJS Transport.TCP analogue).
TcpTransportOptions
TransportError

Statics§

ON_EVENT_REGISTRATIONS

Traits§

MicroCanActivate
Authorization / policy hook before a microservice handler runs (Nest microservice guard analogue).
MicroIncomingInterceptor
Observe inbound patterns (logging / metrics); does not fail the pipeline.
MicroPipeTransform
Transform inbound JSON after guards (Nest microservice pipe analogue).
MicroserviceHandler
A Nest-style microservice handler registry entrypoint (controller/service methods annotated with #[message_pattern] / #[event_pattern] via the #[micro_routes] impl macro).
MicroserviceModule
Implemented by #[module(microservices = [...])] to declare which providers handle patterns.
MicroserviceServer
Transport

Functions§

handler_factory
wire_on_event_handlers
Subscribe all #[on_event] handlers registered via #[event_routes].

Type Aliases§

MicroserviceHandlerFactory
ShutdownFuture