'use strict';
const amqp = require('amqplib');
const { isFatalError: isFatalAMQPError } = require('amqplib/lib/connection');
-const common = require('./common');
+const { fileScope } = require('@squeep/log-helper');
-const _fileScope = common.fileScope(__filename);
+const _fileScope = fileScope(__filename);
/**
* Base class common to worker publisher and consumer, handling
*/
constructor(logger, options) {
this.logger = logger;
- this.options = Object.assign({
+ this.options = {
url: undefined,
name: 'messages',
prefix: 'squeep',
queueType: 'quorum',
retryDelayMs: 10000,
prefetch: 1,
- }, options);
- this.options.socketOptions = Object.assign({
+ ...options,
+ };
+ this.options.socketOptions = {
noDelay: undefined,
timeout: undefined,
keepAlive: undefined,
keepAliveDelay: undefined,
clientProperties: undefined,
- }, options.socketOptions);
+ ...options.socketOptions,
+ };
this.connection = undefined;
this.channel = undefined;
/**
- * Establish the necessary connections to the queue and lock services.
+ * Establish the necessary connections to the queue.
*/
async connect() {
const _scope = _fileScope('connect');