Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to reconnect to NATS #1681

Closed
arvindh123 opened this issue Dec 9, 2022 · 1 comment · Fixed by #1686
Closed

Failed to reconnect to NATS #1681

arvindh123 opened this issue Dec 9, 2022 · 1 comment · Fixed by #1686

Comments

@arvindh123
Copy link
Contributor

arvindh123 commented Dec 9, 2022

BUG REPORT

  1. What were you trying to achieve?
    Publishing of message from MQTT to NATS

  2. What are the expected results?
    Publishing of message from MQTT to NATS

  3. What are the received results?
    Message not published ,got the error message Error publishing to Mainflux nats: connection closed

  4. What are the steps to reproduce the issue?
    Kill the NATS connection and wait for some time,
    Then try to publish via MQTT. The same goes for HTTP and other adapters. Nats auto-reconnect gets exhausted and the connection is permanently closed.

  5. In what environment did you encounter the issue?
    Docker 20.10.21, Docker Compose 2.14.1, Linux, Latest Mainflux version

  6. Additional information you deem important:
    Nats reconnect param can be configured to keep trying to re-establish connection indefinitely.

@arvindh123 arvindh123 changed the title MQTT Error publishing to Mainflux nats: connection closed MQTT failed to publish message to NATS , after NATS connection closed for long time Dec 14, 2022
@arvindh123
Copy link
Contributor Author

The NATS Golang library, will try to reconnect for some times.
We should use callback to handle connection close or we should try reconnect on publish error

@arvindh123 arvindh123 changed the title MQTT failed to publish message to NATS , after NATS connection closed for long time MQTT failed to publish message to NATS , If NATS connection was lost and not restored for long time Dec 14, 2022
@dborovcanin dborovcanin changed the title MQTT failed to publish message to NATS , If NATS connection was lost and not restored for long time Failed to reconnect to NATS Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant