Trying to connect to NATS STREAMING SERVER throws error : NatsError: stan: connect request timeout

I'm trying to connect to nats streaming server from node-nats-streaming library. The nats server is not a docker image this one is installed via package manager in Linux. The server is running fine as when I run it, it shows the streaming server is ready. enter image description here

but after this when I try to run my application it throws the following request timeout error.

NatsError: stan: connect request timeout **code: 'stan: connect request timeout', chainedError: NatsError: The request timed out for subscription id: -1 at Timeout. at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) { code: 'REQ_TIMEOUT', chainedError: undefined } **

This is the code which I'm using to connect to the service enter image description here

I'm new to nats and searching for this specific issue is not giving back any solutions, Hope you guys can help me fix this issue.

Regards



Read more here: https://stackoverflow.com/questions/64899226/trying-to-connect-to-nats-streaming-server-throws-error-natserror-stan-conne

Content Attribution

This content was originally published by sajanthomas01 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: