Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NATS.IO NATSNoRespondersException

Tags:

nats.io

I'm new to NATS and I have taken over an almost finshed application in NetCore 5.0. When I'm startning the application a Connection is set to an docker NATS server and this properties are set in appsettings.

"NatsSettings": {
  "Url": "nats://localhost:4222",
  "StreamName": "nats-server",
  "Timeout": 10000,
  "Verbose": true,
  "StreamReceivedSubject": "TestData.received.Subject",
  "ReceivedConsumerName": "TestData.Received.Consumer.Name",
  "ConsumerReceivedSubject": "TestData.Consumer.Received.Subject",
  "ConsumerReceivedFilter": "TestData.Received.Filter",
  "Subjects": [
    "TestData.*"
  ]
}

What am I missing in the settings for the connection? The error message I keep on getting is NATS.Client.NATSNoRespondersException: 'No responders are available for the request.'

Can anyone help me?

KR Jörgen

like image 241
Jono Avatar asked Sep 15 '25 22:09

Jono


2 Answers

I got this error because I haven't enabled jetstreams

Run docker image with -js tag. It will work

 docker run -p 5555:4444 nats -p 4444 -js

For More reference https://hub.docker.com/_/nats/

like image 141
Rupak Avatar answered Sep 17 '25 12:09

Rupak


You get a 'no responder' when the server knows that there are no processes currently listening for your request. Rather than publishing the request and getting a timeout if no-one listening for those requests, this exception is there to let you know right away that there is currently no-one to service your request.

See this link for more information.

like image 36
JNM Avatar answered Sep 17 '25 11:09

JNM