- 
                Notifications
    
You must be signed in to change notification settings  - Fork 232
 
Open
Labels
proposalEnhancement idea or proposalEnhancement idea or proposal
Description
Proposed change
Raise an Error when the client has exceeded the configured max_reconnect_attempts for all servers in the connection pool.
Use case
async def connect_to_nats():
      nc = NATS()
      try:
          await nc.connect(
              servers=["nats://nats1:4222", "nats://nats2:4222"],
              max_reconnect_attempts=10,
              reconnect_time_wait=2
          )
      except nats.errors.MaxReconnectAttemptsExceededError as e:
          # Definitive permanent failure - all retries exhausted
          logger.critical(f"NATS permanently failed after {e.max_attempts} attempts")
Contribution
I have a proposal for the code change.
Metadata
Metadata
Assignees
Labels
proposalEnhancement idea or proposalEnhancement idea or proposal