How to use the nats.CONN_ERR function in nats

To help you get started, we’ve selected a few nats examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hemerajs / hemera / packages / hemera / lib / constants.js View on Github external
/**
 * Copyright 2016-present, Dustin Deus (deusdustin@gmail.com)
 * All rights reserved.
 *
 * This source code is licensed under the MIT-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */
const NATS = require('nats')

module.exports = {
  // General
  NATS_QUEUEGROUP_PREFIX: 'queue',
  // NATS conn error codes
  NATS_CONN_ERROR_CODES: [
    NATS.CONN_ERR,
    NATS.SECURE_CONN_REQ,
    NATS.NON_SECURE_CONN_REQ,
    NATS.CLIENT_CERT_REQ
  ],
  // NATS errors
  NATS_TRANSPORT_ERROR: 'Could not connect to NATS!',
  NATS_TRANSPORT_CLOSED: 'NATS connection closed!',
  NATS_TRANSPORT_CONNECTED: 'Connected!',
  NATS_PERMISSION_ERROR: 'NATS permission error',
  NATS_TRANSPORT_RECONNECTING: 'NATS reconnecting ...',
  NATS_TRANSPORT_RECONNECTED: 'NATS reconnected!',
  NATS_TRANSPORT_DISCONNECTED: 'NATS disconnected!',
  // Hemera request types
  REQUEST_TYPE_PUBSUB: 'pubsub',
  REQUEST_TYPE_REQUEST: 'request',
  // Application errors

nats

Node.js client for NATS, a lightweight, high-performance cloud native messaging system

Apache-2.0
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis