This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Record - nats : ConnectionConfig

Configurations related to creating a NATS streaming subscription.

Closed record


  • connectionName string (default ballerina-nats)
  • Name of the connection (this is optional)

  • maxReconnect int (default 60)
  • Maximum number of reconnect attempts. The reconnect state is triggered when an already established connection is lost. During the initial connection attempt, the client will cycle over its server list one time regardless of the maxReconnects value that is set. Use 0 to turn off auto reconnecting. Use -1 to turn on infinite reconnects.

  • reconnectWaitInSeconds int (default 2)
  • The time(in seconds) to wait between the reconnect attempts to reconnect to the same server

  • connectionTimeoutInSeconds int (default 2)
  • The timeout (in seconds) for the connection attempts

  • pingIntervalInMinutes int (default 2)
  • The interval (in minutes) between the attempts of pinging the server

  • maxPingsOut int (default 2)
  • The maximum number of pings the client can have in flight. The default value is two

  • username string
  • The username for basic authentication

  • password string
  • The password for basic authentication

  • token string
  • The token for token-based authentication

  • inboxPrefix string (default _INBOX.)
  • The connection's inbox prefix, which all inboxes will start with

  • noEcho boolean (default false)
  • Turns off echoing. This prevents the server from echoing messages back to the connection if it has subscriptions on the subject being published to

  • enableErrorListener boolean (default false)
  • Enables the connection to the error listener

  • secureSocket SecureSocket? (default ())
  • Configurations related to SSL/TLS