ulo
ulo
Documentation

Start here

Coming from NestJSNestJS topics, mapped

The model

Protocols

OverviewRPC controllersStreamingClientDeadlinesServerLinksTCPUDPNATSRedisRabbitMQMQTTKafka

Integrations

Operating

Reference

Microservices

Redis

The Redis link, Pub/Sub per pattern with the whole frame as the message.

The Redis link subscribes to a Pub/Sub channel per pattern. Every message is one whole frame in the link's codec, and replies arrive on a per-client reply channel.

app.bind(ulo_rpc::Server::new(ulo_rpc_redis::Redis::url("redis://cache:6379")));

Settings

MethodEffect
Redis::url(url)redis://, or rediss:// under the crate's tls feature
codec(Codec)JSON by default; Codec::Cbor carries raw bytes
with_handle(Handle)the tokio runtime, when the link is built outside one
ulo-rpc-redis = { version = "=0.1.0-alpha.3", features = ["tls"] }

One server instance for requests

Pub/Sub has no competing mode. Every server instance subscribed to a pattern runs the handler for a request published to it, and the client keeps the first reply and drops the rest. The link declares that it does not deliver once, and a server mounting request handlers or events left at the default on it logs a warning. Run one server instance per such pattern. An event declared #[ulo_rpc::event("pattern", every_instance)] reaches every subscribed instance, as Pub/Sub does.

Behaviour

  • Misses. A PUBLISH with a receiver count of zero is mapped to unavailable with the reason no_destination.
  • Lost connection. A call waiting when the client's Pub/Sub connection drops fails Unavailable.
  • Delivery. At most once, ordered per channel. No frame limit is declared. A frame is bounded by what Redis accepts.
  • Wire. A req or open frame carries the caller's reply channel in its headers as ulo-reply, which the server removes before a handler reads them. in, in_end and cancel travel on ulo:rpc:control, which every server subscribes to. A caller's frame ids start at a random offset so two callers never name the same call.
  • Drain. The server unsubscribes and waits for Redis's reply.

NATS

The NATS link, queue-group subscriptions, inbox replies and no-responders.

RabbitMQ

The RabbitMQ link, a queue per pattern with reply_to, correlation_id and publisher confirms.

On this page

SettingsOne server instance for requestsBehaviour