Skip to content
Exercise · NATS: subjects and queue groups · lesson 7 of 8

Exercise: a request with a time-out

A service asks another service through NATS and waits for the answer. The client subscribes to a new reply subject, publishes the request with that subject and takes the first message that arrives on it, but waits no longer than a time-out. The broker in this exercise is a model in the tests file, not a real NATS: a Conn connection with no network and no server, on a virtual clock.