Skip to content

nats req ignores --reply-timeout argument and always times out after 5 seconds #1593

@shadone

Description

@shadone

Observed behavior

I use request-reply and I cannot get the reply using nats-cli my server replies too slow - in my case it takes around 10 seconds to reply.

nats-cli req command has command line argument --reply-timeout but whatever I pass, it always times out after 5 seconds.

I follow this documentation https://docs.nats.io/nats-concepts/core-nats/reqreply/reqreply_walkthrough

This seems very similar to the other issue I reported previous - nats obj get was also timing out after 5 seconds #1534

Expected behavior

I expect nats-cli to wait long enough to get the reply from my server.

nats req --reply-timeout=50s hello hello

Server and client version

$ nats --version
0.3.1
$ nats-server --version
nats-server: v2.12.4

Host environment

macOS 15.6.1

$ uname -a
Darwin minbar.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020 arm64

Steps to reproduce

Start reply client in one terminal

nats reply hello --command 'bash -c "sleep 10s && echo hi"'

Send a request from another terminal

# I expect this to timeout after 1 second but it still waits for 5 seconds instead
$ time nats req --reply-timeout=5s hello hello
19:03:34 Sending request on "hello"
nats req --reply-timeout=5s hello hello  0.02s user 0.02s system 0% cpu 5.036 total
# I expect this to get the reply after 10 seconds but instead it times out after 5 seconds
$ time nats req --reply-timeout=50s hello hello
19:03:18 Sending request on "hello"
nats req --reply-timeout=50s hello hello  0.01s user 0.01s system 0% cpu 5.022 total

Metadata

Metadata

Assignees

Labels

defectSuspected defect such as a bug or regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions