I will.

From: sbellone <notifications@github.com<mailto:notifications@github.com>>
Reply-To: VirtuOz/smart-router <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Friday, March 1, 2013 8:40 AM
To: VirtuOz/smart-router <smart-router@noreply.github.com<mailto:smart-router@noreply.github.com>>
Cc: Kevan Dunsmore <kevan.dunsmore@nuance.com<mailto:kevan.dunsmore@nuance.com>>
Subject: Re: [smart-router] Add nagios checks for rabbit mq (#10)


In lib/smartrouter.js:

> +    this.amqp.queue(destactorid, { passive : true}, function(queue) {
> +    })
> +    .on('error', function(err) {
> +      var err_msg = util.format('The queue [%s] does not exist (%s). The following message (type=\'%s\') *is LOST*: %s',
> +                                destactorid, err, type, JSON.stringify(message));
> +      logger.error(err_msg);
> +      self._storeNagiosEvent(new NagiosCheckResponse(NagiosCheckResponseCodes.ERROR, EVENTS_CONTROLLER_SUBSYSTEM, err_msg));
> +      if (socket) // Prevent new config deployment issues
> +      {
> +        socket.emit('error', 'Sorry, your message could not be delivered. Please contact support team.');
> +      }
> +    }).on('open', function(queueName, messageCount, consumerCount) {
> +      // If the queue exists, we publish (publishing on a non existing queue will lose the message anyway)
> +      if (consumerCount < 1)
> +      {
> +        var warn_msg = util.format('Queue [%s] does not have any consumers. (Pending message(s) before publishing: %d)', queueName, messageCount);


Oliv started that. Hit him for me when he comes back please.

—
Reply to this email directly or view it on GitHub<https://github.com/VirtuOz/smart-router/pull/10/files#r3206833>.